Questions tagged [image-transforms]

Craft's native, non-destructive image manipulations.

Filter by
Sorted by
Tagged with
1 vote
1 answer
30 views

Passing a variable to an include to set an image transform throws Setting Unknown Property error

I'm using an entry field to set an image transform handle: {% set format = block.imageCrop %} Then I'm trying to pass that to an include: {% include 'partials/_img' with { format: format } %} This ...
artmem's user avatar
  • 1,012
1 vote
1 answer
40 views

I'm trying to remove transforms if my image is an svg? Any tips or advice would be great

{% for icon in icons %} {% set image = icon.icon.one() ?? null %} {% if image %} <div class="c c-md-6 c-lg-6"> ...
Han's user avatar
  • 13
1 vote
1 answer
66 views

Generate an Image from Title

I would like to generate image automatically on entry save, using the entry Title and a specified image as a background. I was thinking to use the Preparse Field plugin, but it seems like it's not ...
Michal Bulla's user avatar
1 vote
1 answer
27 views

Image Transform do not seem to save

We have about 700 images, with only a few transformations possible (about 10). For some reason, the queue for "Image transformation" keeps getting bigger, and even once it gets all processed ...
Ebpo's user avatar
  • 113
0 votes
0 answers
18 views

New install, re-indexed Amazon S3 folders, Craft not creating/finding transforms

Yesterday I re-indexed the contents of my image library on Amazon S3 to a fresh install. I can see the images in Assets, I can use the images in entries and then tags/templates, I can import entries ...
Emma Swann's user avatar
1 vote
1 answer
107 views

Retrieve storage path of image transform instead of URL

I'm generating base64 encoded strings of very small image transforms to display a blurred version of images while the bigger asset is loading. I'm trying to get the cached transform path (if it ...
Capsule's user avatar
  • 131
1 vote
1 answer
105 views

Eager loading results in more queries

From what I understand it is wise to always eager load assets, I used it successfully in other cases, but here it results in a more queries, not fewer. I am trying to eager load an asset in a matrix ...
fdelaneau's user avatar
  • 123
0 votes
1 answer
71 views

Transformed JPGs have larger file size than original

Question Why is it that sometimes a transformed JPG is larger than its original when it is transformed using Craft image transforms even though in my general.php file I set upscaleImages to false? ...
fr-haus's user avatar
  • 58
1 vote
2 answers
135 views

How to force a default transform on existing content within a Redactor field

There isn't much documentation out there about how to apply image transforms to images in a Redactor field. I found this: Apply transform to image uploaded into Redactor? And it's useful, since I can ...
Álvaro Franz's user avatar
2 votes
1 answer
606 views

Transform image in webp and get srcset

Is possible from a jpg image from an entry field return a serset in webp fomat? Something like: <source type="image/webp" srcset="800w webp image, 1200w webp image "> ...
Davide's user avatar
  • 35
1 vote
1 answer
698 views

Image transform returns error

I'm trying to optimise page speeds for my website. One thing I'm looking into is optimising image file sizes, but Image Transform in CraftCMS doesn't seem to work. Before: {% set asset = entry....
Arnaud's user avatar
  • 11
1 vote
1 answer
38 views

How can I use a transform on images in a body field that have been imported?

I have imported content into an old news entrytype for a news channel. The odd image in the body field is 4000px wide. Is there a way of automatically transforming these in a template or from the CLI? ...
joomkit's user avatar
  • 1,994
1 vote
0 answers
146 views

CraftCMS Image Transform returning NULL on asset.url when stored on AWS S3 Bucket

So i'm using Craft as a headless CMS with a React frontend. When querying assets on a S3 bucket and applying a transform to them in my GraphQL query the URL response is NULL. This isn't the case when ...
samroberts707's user avatar
0 votes
1 answer
1k views

Craft CMS images transform srcset sizes

I'm new to craft cms and I'm trying to generate srcset sizes for an image with the following code. {% set thumb320 = { width: 320, format: 'jpg' } %} {% set thumb320_2x = { width: 640, format: 'jpg' } ...
Samuel's user avatar
  • 69
1 vote
0 answers
45 views

Limiting image transform totals in queue?

In order to serve webp images where possible, and different sizes for different screens etc, I created a bunch of image transforms over the weekend - forgetting just how many images we have in the ...
Emma Swann's user avatar
1 vote
2 answers
987 views

image transform to webp image format

I would like to ask how to convert or transform image format to webp. Based on Craft CMS Documentation 3.x, you can set the image format to jpg, png, gif and webp but there is no webp available in my ...
Jeriel Jacinto's user avatar
1 vote
1 answer
155 views

Using a variable with getUrl()?

I'd like to be able to use a variable with the getUrl() method so I can change the filter parameter on the entry page (user controlled) instead of in the source code: style="background-image = ...
Britchie's user avatar
  • 215
1 vote
1 answer
418 views

Using NextJS image component with CraftCMS

NextJS has a really nice image component. To implement this I need to create a custom serialiser to get the image sizes from Craft . I can define a custom loader, however I'm not sure how feasible ...
Callum's user avatar
  • 193
1 vote
1 answer
132 views

Image Transforms and AWS

I regularly use srcset to serve large images, such as heroes, and take advantage of Craft's image transform capabilities in the implementation, e.g. <img srcset="{{ image.getUrl('img500') }} ...
Roi Agneta's user avatar
  • 1,403
2 votes
4 answers
286 views

TWIG dataUrl function for resized images

Craft provides the very nice TWIG function dataUrl(pathToImg) to inline images in e-mails. E.g. <img src="{{ dataUrl('@webroot/assets/img/logo.svg')" /> will base64 encode the image ...
Matthias Redl-Mann's user avatar
1 vote
1 answer
82 views

Does deleting an original asset but keeping the transform folder asset make Craft replace the original file with the biggest transform?

I have a client who has uploaded many giant images to the CMS (8mb+). I'd like to free up that space now that those image have been transformed to more web-friendly sizes. Is it safe for me to delete ...
patrick.altair's user avatar
2 votes
1 answer
286 views

How to detect white background

In my product catalog, some product images need to have the css attribute object-fit: cover while some need the object-fit: contain: I'd like to detect the white background, possibly on upload (to ...
nitech's user avatar
  • 679
0 votes
0 answers
37 views

Why do image Transformations never finish rendering regardless if I use GD2 or ImageMagick?

I'm running Craft 2 with PHP 5.6.40 on a Windows 2019 Server under IIS (x64, non-thread-safe, FastCGI). PHP -m doesn't show any issues with my extensions, regardless if I use GD2 or ImageMagick. But ...
J.D.'s user avatar
  • 101
1 vote
1 answer
128 views

Image Transforms not generated - permission problem?

Since I installed my Craft based website on the production server the image transforms are no longer generated. The tasks runs through more than 5000 images but doesn't generate new ones. There have ...
obs's user avatar
  • 467
1 vote
1 answer
199 views

Generate transforms only working on default install (multi-site)

I have a multi-site setup running within Craft 3. Everything seems to be working nicely, except for image transforms. For example: The following transform on the default site works correctly: https://...
GazCrane's user avatar
0 votes
1 answer
320 views

Changing Image transforms for different media queries

Is it possible to set different image transforms for different media queries? I have a grid layout containing 1 large image and four smaller images on large screens. I have created two image ...
Adam's user avatar
  • 245
1 vote
1 answer
136 views

How to reprocess image transforms that already exist in the database

If I import a Craft DB into my local db, and it has references to image transforms that existed in another environment, it won't recreate them in the filesystem when a page is loaded that asks for one ...
Brimby's user avatar
  • 313
1 vote
2 answers
555 views

Animated GIFs not working in Craft with ImageMagick installed

When I upload a GIF I either get the first frame or a garbled image (https://share.getcloudapp.com/L1u7BXrA). Looking around at similar questions, Craft needs ImageMagick installed to properly ...
Lee's user avatar
  • 173
1 vote
1 answer
230 views

Forcing creation of all transformations for all assets

Regarding a similar question I only found the advice to delete a table in the database but because I don't like fiddling with the db very much I like to ask: Are there ways to force craft to generate ...
Matthias's user avatar
0 votes
0 answers
662 views

Image Transform change causes 500 Internal Server Error

I had an image transform set on an entry that was working as expected. I updated the code, and it didn't work, so I reverted back to the old transform. It was literally going from src="{{ image....
Shad's user avatar
  • 451
1 vote
1 answer
59 views

CP transform renders image 404

I have a transform in my CP called detail large. IN my template the image will render normally. <img class="img-fluid" src="{{ image.getUrl() }}" > Wen i want to use the transform like below: ...
joomkit's user avatar
  • 1,994
0 votes
0 answers
129 views

Apply image transform after image is placed on page

I have an overview (i.e. list with around 150 items). Each of those items has an appropriate "teaser image". When a user is hovering a list item the appropriate teaser image fades in, on mouse out it ...
Christoph Berger's user avatar
1 vote
1 answer
184 views

Image processing in headless mode

How to do image processing & transformations when not using templates? I'm using react-static for the frontend. Is it possible to have CraftCMS process the images upon upload?
riccardolardi's user avatar
1 vote
1 answer
297 views

Image Transform of Transparent Images results with Black Background

As the title suggests, I am receiving a black background on my transparent PNGs. I'd prefer them to be white. I have enabled imagemagick in the config file but still no dice. I noticed GD library ...
Geoff Baumbach's user avatar
1 vote
0 answers
106 views

FortRabbit - performance - image transforms

Anybody else have problems with image transforms on FortRabbit? They sent me this article as some background - https://blog.fortrabbit.com/imagemagick-issues I was using the light level of hosting (...
Malcolm Maclean's user avatar
1 vote
1 answer
318 views

Image transforms not working on front-end

I'm able to upload images correctly to the server. I can see the thumbnail and view the larger image inside the control panel on the Assets page. However, the front-end image transforms result in a ...
Anna_MediaGirl's user avatar
1 vote
1 answer
85 views

Can I use GraphicsMagick with Craft CMS?

Short question: Can I use GraphicsMagick with Craft CMS? If yes, how can it be configured? thanks
Matthias Redl-Mann's user avatar
2 votes
1 answer
3k views

How can I set an absolute image url for Open Graph Image tags?

I need the final tag to look like this: <meta property="og:image" content="http://mysite.com/uploads/resources/_hero/myimage.jpg"> If I use something like this: {% set seoImage = entry....
Josh Coast's user avatar
1 vote
1 answer
31 views

Craft Equivelent of EE addon CE Image Bulk Tag?

I'm preparing to migrate an old ExpressionEngine site to Craft and there are channels with images that are being resized by wrapping the rich text editor with ce image bulk tag like this: {exp:ce_img:...
CreateSean's user avatar
  • 1,963
1 vote
1 answer
158 views

Select Transform Feature with Asset Field

If you insert an image in a Rich Text field you get an option to apply a transform, but that is not true when using an Asset field to choose an image, which seems strange. Is there any way to ...
Roi Agneta's user avatar
  • 1,403
1 vote
1 answer
46 views

modify image contrast

In my experience is the build-in process of image transform not too kind to the image quality, even with the highest quality. In my case the brighter tones in the images are lost which means that ...
analog junkie's user avatar
1 vote
1 answer
453 views

Craft isn't regenerating the image transform when the focal point changes

I've got a basic image transform in a template: {% set crop = { mode: 'crop', width: 560, height: 550, quality: 80 } %} <img src="{{ image.getUrl(crop) }}"> Once the ...
Sandwich's user avatar
  • 626
0 votes
1 answer
2k views

Image Transforms not happening

Apologies if this has come up before. I did check but the previous post referred to version 2.x and was regarding a bug. I have set up 2 image transforms for images but nothing works. The assets ...
Anthony's user avatar
  • 103
2 votes
1 answer
469 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=...
Urs's user avatar
  • 639
1 vote
2 answers
764 views

Is it possible to get a transformed image's file size (bytes, not dimensions)?

I'm using a transformed image in a context where there's a maximum file size. Is there a way to determine the transformed image's file size in the templates? .size can't run on the url string
henry's user avatar
  • 228
2 votes
2 answers
63 views

Apply imageTransform on twitter media feed

{% set response = craft.twitter.get('statuses/user_timeline', { tweet_mode:'extended', count: 20 }) %} {% if response.success %} {% for tweet in response.data %} {% ...
Nutmeg's user avatar
  • 598
2 votes
1 answer
486 views

How to make PNGs crisp using Imager + Optipng and Craft 3?

I've installed Imager in a Craft 3 site and everything looks fine except my PNGs are fuzzy. I've set 'pngCompressionLevel' => 0, because I'm using Optipng and the docs say to do this. The PNGs have ...
Ryan's user avatar
  • 1,942
9 votes
3 answers
5k views

How do image focal points work in Craft 3?

How do image focal points work in Craft 3? I see the dot in the CP, but I'm unable to set the focus.
Kantesh Hotchandani's user avatar
1 vote
1 answer
398 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".
Kantesh Hotchandani's user avatar
2 votes
1 answer
231 views

Set max-height on image transforms?

Is it possible to define an aspect ratio / set a max height on an image transform, without using a plugin? Let's say the width is fixed to 600px, but the height can be any value up to 800px?
James Greig's user avatar

1
2 3 4 5