Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [image]

The tag has no usage guidance.

1
vote
1answer
19 views

Sideloading an image from a function in a plugin

I need to be able to side load an image and attach to an entry. My image is coming from an external url... such as http://someplace.com/image.jpg - i can store this in a temporary file so its locally ...
1
vote
1answer
18 views

How can I fix Image Exception error when uploading image via front-end form while Preparse plugin enabled?

I'm not sure if the issue is with Craft 3, the Preparse plugin, or me, so I'm posting here first. I have a front-end form that includes an Assets field used to upload images. The entry type contains ...
1
vote
1answer
22 views

Update field setting value using getFieldByHandle

I need to update the limit setting for Images allowed to be empty, so as to allow for no limit. How do I go about updating the 'limit' setting? $fieldsService = Craft::$app->getFields(); $field = $...
1
vote
1answer
34 views

Is there a way to allow users to control alignment of images in the Redactor plugin using Craft 3

I'm looking to let editors determine the alignment of images in a Redactor field. I wasn't sure if it worked out of the box with Craft 3 (I'm using 3.0.9). I did find this plugin: https://github....
2
votes
1answer
46 views

Focal point: more control?

I originally had this setting in twig for gallery thumbnails: {% set square150 = { mode: 'crop', width: 150, height: 150, quality: 75 position: 'center-center' } %} <img width=...
1
vote
1answer
66 views

Eager loading on entry not reducing queries

Using this snippet returns me 38 queries on my homepage without the Eager Beaver plugin. {% do craft.app.elements.eagerLoadElements( className(entry), [entry], ['headerImage', 'image1', '...
1
vote
0answers
13 views

Redactor image default filter

Is it possible to define a default filter for an image inserted in Redactor text ? Filter twig for front or config ? Thanks
1
vote
1answer
23 views

Is there any way to replace the asset programatically?

In the CP, when we upload an image with a same name, craft will ask if we wanna keep both or replace. So in plugin, is there any way to do the replace?
0
votes
0answers
40 views

How to upload an image to an entry?

In front-end, I have a file input field with the name headerImage. <input type="file" class="form-control" name="profileImage" accept="image/*"> At the back-end, I do something like this: $...
2
votes
1answer
46 views

Problem pulling Tweets with media using Dukt's Twitter API plugin

{% set tweets = craft.twitter.get('statuses/user_timeline', { tweet_mode:'extended' }) %} {% for tweet in tweets %} <li> {% if tweet.extended_entities.media is defined %} {% ...
1
vote
1answer
21 views

How to create a border + border colour field on an image

My first question here... maybe one of a few! I've inherited a Craft project recently and don't have much experience with it. I want to allow admin to set a border (and border color) whenever they ...
0
votes
0answers
18 views

JPG assets won't upload with image driver GD

I'm really not sure what's going on here. The server has GD extension installed as the image driver. I cannot install imagemagik, it's outside of my control. Image assets like .png and .gif upload ...
0
votes
0answers
58 views

Craft 3 zero byte asset upload AJAX

I'm using the upload method like the answer in this overflow post in combination with AJAX & new FormData($(this)[0]). It works fine, but sometimes files (assets5b5207f23605a3.51574157.jpg) have 0 ...
0
votes
0answers
33 views

I can access an asset filename, but not its URL

At first I was trying to use the one(), but it always told me the Object of class Craft\ElementCriteriaModel could not be converted to string So searching the documents, I found first(), and that ...
1
vote
1answer
27 views

How to display a featured image in the list of entries

I created a field which uploads an image, and I want it to display it for each of my entries inside my for loop. What's the code I should use to do it?
1
vote
1answer
93 views

Commerce PDF error: Image not found or type unknown

In the order template, this error shows up in the generated PDFs when adding standard JPG images. We're running Commerce 1.2.x on PHP70. It could be related to this dompdf issue, but how do we fix ...
1
vote
3answers
66 views

Flip PDF embed inside templates

I have some 'Flip PDF' generated folders that I need only logged in users to be able to access. If I put them in templates I get the problem that the .jpg images 500. Is there a way of allowing .jpg ...
1
vote
1answer
100 views

Image quality get low in Craft 3 after applying image transform

As of now I am using Craft's image transform to render images according to the size. If this still appears low quality even Image Transform setting with qulity "Maximum".
1
vote
2answers
74 views

How can I get the image picker on the WYSIWYG editor?

I am running on the latest version of Craft (Craft CMS 2.6.3015). I have a blog entry, which has a Rich Text editor for the body field. However, I do not have an image or file upload field in the ...
1
vote
1answer
157 views

block.image.one() shows more than one image

I'm sure I'm doing something wrong here, but I'm at a loss as to what. I'm using Craft 3. My travel entry has 7 fields, one of those being a matrix field. My matrix has two blocks, postText and ...
0
votes
1answer
45 views

Serialization of 'Closure' is not allowed when upload image [duplicate]

I built up a form at the frontend to allow users to upload their avatars,my code looks like below <form method="post" accept-charset="UTF-8" enctype="multipart/form-data"> {{ csrfInput() }} ...
1
vote
1answer
36 views

Random transforms

We are using a masonry grid, with 3 image sizes (different heights). The images are (one of) the banner image(s) from the news entries. We played around with this, however this doesn't work as we need ...
3
votes
2answers
1k views

Craft 3 image asset getUrl() not showing

I came across an interesting issue. I'm using Craft CMS 3.0.0-RC14 and non of my image paths are showing but the title and the file name does. {% set image = nav.navLogo.one() %} {{image.title}} // ...
0
votes
1answer
39 views

Images missing, service unavailable

Folks: When users visit the site only some of the images on the page show. Checking Chrome dev tools shows that the missing images are failing with "server unavailable" errors. The image is there if ...
1
vote
1answer
105 views

Asset Field: Select a folder instead of all images

Is there a way to pick a folder from an asset field? The goal is to render a dynamic gallery from an asset folder (which is on S3) instead of selecting all images inside a folder by hand. Use case: ...
1
vote
2answers
220 views

How can I create a zip file containing all assets from an entry gallery?

I'm trying to create a download button which will allow the user to quickly download all assets in an entries image gallery. I've started by adding each image url into an array stored in a data attr ...
1
vote
1answer
57 views

Default Upload Location needs matrix field and entry info… How?

I have a towns entry with a matrix field: townAlbums. This matrix field has just one block type: photoAlbum. This one block type has two basic text fields (the important one being albumName and one ...
1
vote
1answer
43 views

How can I reference images in a rich text field?

I need to reference an image in a rich text field separately to the text. So I can't just use {{entry.body}} I need to be able to do {{entry.body.image}} or something comparable. How can I do ...
1
vote
1answer
218 views

Display a specific image from assets

I'm trying to grab a specific image to display that is located in assets. I tried using {% set image = craft.assets.filename('image_filename.jpg') %} but I get the error "An unknown image object was ...
1
vote
1answer
166 views

Can't output an image

just getting start with Craft, and I can't figure out why my images won't output. Any time I try to output even the path to the url of my image, I get an internal error: Craft\AssetFileModel and its ...
3
votes
1answer
89 views

How to find and replace an <img src> tag?

I have <img src="/path/file-to-be-replaced.png"> in a Single-Line Text Type in a Table Field Type which is inside a matrix. Now I want to replace all of them through Find and replace option. But ...
1
vote
2answers
148 views

Change/update the default user profile photo/thumbnail folder location

I'm having a hell of a time tracking where i can change/update the default user profile photo/thumbnail folder location. I keep reading and have tested that you can create a new volume for assets. My ...
3
votes
1answer
40 views

Find entries with at least 1 image

How can I find entries with at least 1 image? {% set category = craft.categories.group('storyCategories').slug(catSlug).first() %} {% set params = { section : 'stories', order : 'postDate desc', ...
1
vote
1answer
453 views

How can I insert images into a Redactor rich text field in a front-end form?

I want to allow registered users to insert (i.e. upload) images into a Redactor rich text field in a front-end form. I dowloaded the Image Manager plugin from Imperavi (https://imperavi.com/redactor/...
0
votes
0answers
63 views

Unable to upload image to assets folder on local, no errors displayed

I think this is a duplication of this question: Asset Uploading via Assets Field Broken, please help I have tried to look at the solutions mentioned but not sure if I am doing them correctly, they ...
2
votes
1answer
188 views

Rotate image according to EXIF orientation not working from a plugin

I am using a front-end form to upload images and store them as assets on an amazon S3 bucket. My server has imagick installed an uses it and in my config I have "rotateImagesOnUploadByExifData" set ...
1
vote
1answer
45 views

Assets have old URL

I've just changed my local development environment from using .local domains to .localhost (no more DNS trouble on MacOS, yay!). So I set Crafts siteUrl to .localhost, and while Craft serves pages ...
0
votes
2answers
50 views

Image does not be shown

Good mornig I am having a problem with my bannerImage. First off i show you how i did it and what the problem is. In the first picture you can see, how i get the image. This method works fine for 3 ...
1
vote
1answer
163 views

Checking for duplicates in array

I'm trying to remove duplicate image objects from an array, but can't figure out why it won't find it: {% for image in product.productGallery %} {% set productGalleryArray = productGalleryArray|...
1
vote
1answer
434 views

Dynamic background image

I'm super new to Craft and was wondering if someone could help. I'm trying to set up a hero banner. So there will be a full-width image, on top of this will be the heading text and a CTA button. I'd ...
0
votes
1answer
40 views

Images Uploaded in CMS not showing on mobile [desktop is fine]

Just want uploaded images for entries to show for desktop AND mobile {% set assets = entry.galleryImage %} {% if assets | length %} {% for asset in assets %} {% if asset.kind == 'video' %} ...
0
votes
1answer
42 views

Image from Another Entry

Is it possible to pull an image from another entry? It seems like it would be simple. I've read a lot of posts and documentation, and feel like I'm close... {% set entries = craft.entries.slug('...
1
vote
1answer
136 views

How to display a specific image from Assets field

I have an Assets field with a set of images. What is the best way to find one image that has 'featured' checkbox checked? This is the code I put together to check which of the images is marked '...
1
vote
1answer
338 views

Craft 3: Image transformation - grayscale

Are there any image manipulation options in Craft 3? Like grayscale or so? (what imager does for Craft 2: https://imager.vaersaagod.no/?img=5&demo=basic-image-adjustments)
1
vote
1answer
111 views

Craft 3 Plugin: Saved image asset has no width / height

In my Craft 3 Plugin I am saving an image (YouTube poster) to an asset volume like this: $asset = new Asset(); $asset->title = $url; $asset->tempFilePath = $tmpPath; // temp path for image in /...
0
votes
0answers
44 views

image in Portrait mode is rotated 90 degrees after upload

Got something weird on one of my sites. Whenever I upload an image (client takes them with his phone in portrait mode) it's turned 90° clockwise. A few Craft updates back I had a similar issue on ...
1
vote
1answer
82 views

Images from tumblr post

I successfully imported my tumblr blog with the amazing Feedme plugin over the rss feed of the blog. The plugin creates posts and feeds the "title", "date", "tag" and of course the "content" inside my ...
1
vote
1answer
80 views

Copy uploaded image in event assets.onSaveAsset

Is there a way to copy an uploaded image in the assets.onSaveAsset event? I want to make a copy of the original uploaded image (for internal purposes) and after that I want to add a copyright text on ...
1
vote
1answer
79 views

Can't Upload JPEGs to live site (PEL error)

I'm unable to upload any jpg/jpeg files to the server, it just comes up with an alert saying "upload failed". After checking the PHP error logs for Craft I found this error message is being created ...
1
vote
1answer
535 views

Can't upload GIF files

I have the same error in here. Craft info says i have installed the ImageMagick extension successfully and even use ‘imageDriver’ => ‘imagick’ in config file. But still cant upload GIF files.