Questions tagged [image]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
24
votes
3answers
6k views

How can I automatically generate responsive images from a single hi-res asset?

I want to be able to upload a single high resolution image, and output a <picture> element that outputs it with a few different sizes and resolutions automatically (using Picturefill to sort out ...
9
votes
2answers
5k views

Looping through images in a Asset field type

Sorry, this is kind of a newbie question, but I can't figure out how to loop trough all images in one image asset field supporting multiple images. The only way I have been able to output anything ...
9
votes
1answer
558 views

Is there a way to find out if images (assets) are landscape or portrait?

In a current project we will list entries in a masonry-style grid view where the entry’s respective cover image should be styled differently based on their image format. Landscape vs. portrait and -- ...
8
votes
1answer
10k views

Fetch Image URL from entry CMS

This seems like it should be really simple. I set the field for an image asset, linked it to the entry type I want it associated to, and then uploaded the image in the cms to the folder I specified. ...
6
votes
1answer
514 views

Is 'real crop' a possibility?

Ok, this is the first time I need this, but here's my question: If crop is selected for a transition, what you get is a scaleAndCrop. Is there a way to do a 'real' crop, so no resizing before ...
6
votes
1answer
402 views

Any workarounds for image resizing in Craft 2.5 Redactor II?

Since imageResizable was deprecated for some apparent reason which I have no idea why they would do that. Does anyone know of a workaround or a plugin/config setting to enable this again?
5
votes
2answers
2k views

Image alignment and size in Redactor 2

Redactor I had a feature that allowed editing of image alignment (via the image popup) and size (by dragging the square bounding box), is it possible to enable this functionality in Redactor II? Is ...
5
votes
1answer
1k views

Images lose quality when I upload to Craft

The images I upload to Craft lose their quality :( Without applying any transformation, the original file is blurred and has a smaller size. I read this on another question: Currently the images ...
4
votes
1answer
3k views

Image asset url is not being output

After going through the documentation I believe that this is the correct code to output the url for the asset field but its not working and I have no idea why. Please help! {% nav program in craft....
4
votes
3answers
544 views

Asset thumbs missing in control panel after Assets Source update

I've updated several Assets Sources on my production site. I've exported / imported the database from production into local - the new Assets Sources are in place but the asset thumbs are now missing. ...
4
votes
1answer
304 views

How can I upload separate 1X and 2X images?

I want my site to serve 1X and 2X images depending on the browser using something like Picturefill, and I don’t want the 1X version to just be automatically generated using a transform - I want to be ...
4
votes
1answer
412 views

How do you output images without “?mtime” at the end of the url?

For some rss readers they have issues with the images having "mtime" at the end of the url. Is there a way to output an image without this?
4
votes
1answer
641 views

Redactor image caption not saved and formatting lost

In Craft CMS 2.6.2945, I've added the "image" button in the Redactor config. In the editor, I've added an image and added a caption (by clicking the inserted image). When the image is saved, the ...
4
votes
2answers
747 views

Is there a way to read IPTC, EXIF or TIFF Metadata in an Image uploaded to Assets?

I'm trying to see if I can get the Date Created on images within an image upload. Not the date the file was created, but the date the picture was taken. If I open an image up in Preview, in the ...
4
votes
3answers
425 views

Can't resize image in Rich Text field since 2.5 update

after upgrade to 2.5, it seems it's not possible to click on the inserted image and resize it in the Rich Text Field. If you click it now, you directly get a popup to give in the Title, link or select ...
4
votes
1answer
270 views

Grab and save image from url to Craft?

I have a cool upcoming project which its content will heavily depend on external images. Although I'd like to get rid of WordPress for this project and would love to use Craft, WP has a great plugin ...
3
votes
2answers
265 views

Is there a way to create a “sticky” asset

I have a list of images that are loaded directly from the content of a specific asset folder. {% for image in craft.assets.find({ folderId: 18, limit: 240, order: filename }) %} What I want to ...
3
votes
2answers
3k 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}} // ...
3
votes
2answers
212 views

Using Image Transform as another custom field

I've created a section with a thumbnail image and also a dropdown to allow the user to select the transformation to apply to that image. I've pre-created all the asset transformations ready and this ...
3
votes
3answers
4k views

Assets (images) return a 404 on the front-end

I have the following issue which I can't seem to wrap my head around. All images assets uploaded to Craft return a 404 not found on the front-end. Everything works fine in the admin CP though (...
3
votes
1answer
436 views

How would I list assets from a specific subfolder?

In the case that I have an asset folder structure like this: /images /group-a /group-b /group-c How would I loop through all of the images in /group-b without having to assign them to ...
3
votes
1answer
1k views

Image upload failed- file not writable

Trying to upload images and get the following error Upload failed for "filename". The error message was "Error uploading the file: The folder "/var/www/html/imgs/logos/" is not writable"
3
votes
1answer
301 views

Plot absolute coordinates / Image map

I have a site where I want to set up a "tour" of a software screenshot, and I need to allow users to select points on an image to insert the tour "stops". Is there an add-on like DevDemon's Entry ...
3
votes
1answer
152 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 ...
3
votes
1answer
96 views

Migrating Content from ExpressionEngine that used Matrix Image haystack Technique

So I'm taking the plunge from ExpressionEngine to Craft! I have a ton of entries I need to move over, though - and I used the "matrix image haystack" technique for my blog posts to inject the images ...
3
votes
2answers
451 views

Find specific image from global image set?

I am using a global set to store image assets used across the site. I am not sure how to reference a specific image. I know how to get the image if its just one, using : {{ design.imgs | length ? ...
3
votes
2answers
633 views

HighRes image crop tool (not Aviary plugin)

Is there an alternative to the Aviary plugin (https://github.com/fruitstudios/AviaryImageEditor)? I only need to be able to offer the client a visual interface for cropping (in 1 aspect ratio only). ...
3
votes
1answer
714 views

GIF animations garbled and static

When I upload animated gif assets to a Craft site, they end up static and corrupted, as so: (Original here.) My guess is that what's displayed is the last frame of the animation (which only contains ...
3
votes
1answer
985 views

Asset thumb missing

I have a problem where some image assets do not produce thumbs. It seems Craft has an issue generating the thumbnail of large images (in pixel-values, not filesize). Does anyone know if this is a ...
3
votes
1answer
308 views

Using the Redactor rich text field, how can I dynamically wrap my images with a fancyBox link (with attributes as parameters)?

I'm using fancyBox (from fancyApps, http://fancyapps.com/fancybox/), and I need to wrap my images added within the Redactor rich text field with a link that had an href to the image source + some ...
3
votes
2answers
272 views

Output a default asset if one hasn't been specified

I've looked at and tried a couple of solutions on here but struggling to apply them to my circumstance. Below is my current code. I would like a 'default' asset (image) to be used if one hasn't been ...
3
votes
2answers
292 views

Image Transforms adding white to edges of image

I have my image transforms set to crop centre-centre with quality 100, but for some reason the images that are rendered have a high change of having 1 or 2 pixels of white added to at least one set of ...
3
votes
0answers
138 views

Image transforms directory not being created

I've upgraded to El Capitan from Yosemite, created several Image Transforms in the CP (see pic) but they don't seem to be creating the folders in the uploads dir. I've checked folder permissions for ...
2
votes
3answers
1k views

Load an asset at random each page load

I have a single that has 5 banner images. I would like to load a different image each time the page loads. I want to do this with twig not JS, is this possible if so could somone point me in the right ...
2
votes
2answers
365 views

Using Focuspoint with eager loading

I'm using eager loading for retrieving some images for my gallery: {% set employments = craft.entries({ section: 'employments', with: ['photo] }) %} This works fine and I can see all images on my ...
2
votes
1answer
913 views

Importing images from external url and saving to entry using plugin

I'm looking for the correct way to import an image from a url and save it to an entry and in the correct subfolder (uploads/images/{id}) I've created a resource pointing to uploads/images and the ...
2
votes
2answers
391 views

Is it possible to add white background to transformed images?

For a client eCommerce project I am working on all the product images are on white backgrounds, so they blend nicely with the background of the site. Currently I am putting all the images through a ...
2
votes
2answers
1k views

Asset Uploading via Assets Field Broken, please help

*Update: Installed MAMP Pro, reinstalled Craft, asset upload is working now. Not exactly a fix, but seemed like the simplest route of action due to my unfamiliarity with PHP. Thanks to those who ...
2
votes
1answer
331 views

Image transform that only crops if image is larger than set dimensions [duplicate]

At the moment I have an image 300px wide, my transform is set to a width of 600px so it upscales it. I would like it to only transform if the image is over 600px. Is this possible or should I use ...
2
votes
1answer
237 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', '...
2
votes
1answer
1k views

Image transforms not working properly

I have 2 basic JSON files, the only difference between the files is the product.type('') In my general.php I have turned on 'generateTransformsBeforePageLoad' => true, The first JSON file (200 ...
2
votes
1answer
251 views

PHP transformed image?

I’m using Craft to add CMS functionality to an e-commerce website via craft/app/bootstrap.php Trying to pull a 'timeline' structure with a featuredImage Asset Field. This code works and pulls the ...
2
votes
1answer
189 views

Upload Image Custom Field

Is there any "Upload Image" custom field in craft so that I will be able to make my images editable. Thanks for the answer.
2
votes
1answer
482 views

Global Image Variables?

I have setup a global set for images i use across the site. I have one for seo - where I have images for a twitter card and Facebook image in my seo settings. There is only one image for each field ( ...
2
votes
1answer
669 views

How to add dynamic watermarks to images in Craft/Twig

I'm wondering if something is possible in Twig/Craft CMS that I used to do in ExpressionEngine and CE Image. I want to output company logo images, but as they're all different shapes and sizes, I ...
2
votes
1answer
866 views

403 Forbidden Assets

I can't for the life of me figure out what's going on. When assets are added, they upload fine but when I add them to entries or try to view them in the browser, they won't display and show a 403 ...
2
votes
2answers
102 views

Tagging and Associating Photos with Entry Type

We have hundreds of photos on our theater website from past performances. In order to sustainably manage the relationship between cast members and which photos they were in, we wanted to explore ...
2
votes
2answers
1k views

User defined crop / crop modal for image assets

Is it possible to have "user defined" crop areas (drag and crop) for upload assets of type image? What I had in mind is something exactly like craft has in the Admin > Settings > General Settings > ...
2
votes
1answer
53 views

How do I add Alt Image Tags to my photos?

I am trying to figure out how to add alt image tags to my photos. I was under the impression that the "file name" served as the alt image tag in Craft CMS, but no such alt tags are populating...and ...
2
votes
1answer
70 views

Craft 3 Image quality is terrible after asset upload from admin panel

After I upload an asset (png), the image loses quality. I changed the defaultImageQuality from its default value of 82 to 100 but didn't make a difference. I can't add these assets via FTP as I need ...