4 votes

Using Focuspoint with eager loading

After some research I found out that this problem has no simple solution (unfortunately). Check https://github.com/smcyr/Craft-FocusPoint/issues/10. A solution would be not to use eager loading (...
user avatar
  • 287
4 votes
Accepted

Image(r) transform and for loop

When using the for loop you don't need to set image as it is set in the for loop. You will also need to define transformedImage on every iteration, so move it within the for loop. Give the below a go,...
user avatar
  • 735
3 votes
Accepted

Eager load Imager transforms in Craft Commerce

Eager loading is used to reduce the number of database queries. Imager doesn't store any data in the database, it's completely file-based, so it's not relevant to use eager-loading in relation to it.
user avatar
  • 7,248
3 votes
Accepted

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

Unfortunately, resizing images always tends to make them a little bit blurry, especially if the size that it's resized from isn't very big. But, here's a few things you can try: Make sure you're ...
user avatar
  • 7,248
3 votes
Accepted

Use Imager plugin with Element API?

In yii2 every instance of a module is stored in a public static property of the main class. If the plugin is called image you can grab it via Imager::getInstance() This instance contains all the ...
user avatar
3 votes
Accepted

Apply imageTransform on twitter media feed

Craft's built-in transform functionality doesn't support transforming external URLs. You could use my Imager plugin to do this instead. EDIT: Based on your example, you'd use Imager something like ...
user avatar
  • 7,248
3 votes
Accepted

loop through responsive images in matrix with imager plugin

You’re currently passing in the image model you queried for using first() into the craft.imager.transformImage function, but you actually need to pass in the models that you get when looping through ...
user avatar
  • 35.9k
3 votes
Accepted

Trying to set an image URL using a global asset field

I don't know if it's the cause of the error you're receiving or not, but this is incorrect Twig syntax: {% set image = '{{ websitePreferences.placeholderImage.first.url }}' %} You'll never need to ...
user avatar
  • 66.5k
2 votes

Imager plugin using it's transformImage method doesn't produce correctly resized images

Turns out google chrome dev tools was lying to me when i hovered over the images in a srcset and told me their natural size was different to their real size. All working grand!
user avatar
  • 912
2 votes
Accepted

How to suppress server errors in Craft?

It depends on the type of errors that are being thrown. If they are Twig/template errors, then you can can set the suppressTemplateErrors config setting to true and they will simply get logged and ...
user avatar
  • 66.5k
2 votes
Accepted

Preparse responsive images

I've managed to get it working via the following steps: Create a new field and give it the preparse field type Duplicate only the twig variable code from the template into the input box in the field ...
user avatar
  • 543
2 votes

Imager plugin doesn't generate images in multi-language website

Problem solved: imagerSystemPath was set relatively
user avatar
2 votes
Accepted

responsive sizes with imager plugin

This is all pretty well documented here: Creating Optimized Images in Craft CMS But if you need general help on srcset and <picture> elements check out Responsive Images Done Right: A Guide To ...
user avatar
2 votes
Accepted

Using Focuspoint with eager loading

I ran into this issue too and had landed on this thread (and another similar one). I was able to piece together a solution using the modify elements query method. I wrote a pull request that got ...
user avatar
2 votes
Accepted

Matrix gallery with Imager plugin

Assuming it's the field portfolioImage that can have multiple assets, try this: {% for block in entry.portfolio %} {% switch block.type %} {% case "images" %} {% for image in block....
user avatar
  • 7,248
2 votes
Accepted

Use Imager plugin with AssetTransforms defined in admin panel

I've had the same problem. You can do it by creating a custom plugin that returns image transform info. Look here => Get a defined image-transform's width and height in front-end template
user avatar
  • 157
2 votes

Use Imager plugin with AssetTransforms defined in admin panel

You'll have to define your transforms inline - Imager doesn't support named (i.e. CP-/admin-defined) transforms.
user avatar
2 votes
Accepted

Setting Imager crop position dynamically

Your issue is that Craft (or rather, Imager) is not treating your entry.cropPosition Dropdown field as a string; you're essentially passing the actual DropdownFieldType model (an array like object). ...
user avatar
2 votes

Setting Imager crop position dynamically

If the value of imageCrop is a string in the correct format (ie 50% 50%, 0% 0%, or similar), this should do it: {% set entryImage = entry.pageHeader.first() %} {% set imageCrop = entryImage....
user avatar
  • 7,248
2 votes
Accepted

Output assets within a matrix block using Imager and Craft 3

Why do you try to fetch the image multiple times? {% for image in block.logos %} Will fetch the images and loop them {% set logo = block.logos.first() %} -> will fetch the first image again and ...
user avatar
2 votes
Accepted

Assets page "An unknown error occurred"

As noted in the comments, sounds like you've got an error in your Imager config (prob an incorrect value set for the imgixEnablePurgeElementAction option or one of the lines close by).
user avatar
2 votes
Accepted

Imager plugin for watermarks

Have a look a little further down in the Readme and you will see more information regarding Watermark. From the Readme... image: The image that is to be used as watermark. Just as the image ...
user avatar
  • 166
2 votes

switch / rotate images based on device orientation (landscape / portrait)

1. If you need a rotated version of an image but Imager can't transform the image programmatically, you could just create 2 different asset fields for the same image. One field for the landscape ...
user avatar
  • 2,573
2 votes
Accepted

Pass aspect ratio as variable into imager

Your variable assignment is wrong. {% set customRatio == 1/1 %} should be {% set customRatio = 1/1 %}.
user avatar
  • 7,248
1 vote
Accepted

Imager Transforms, Cacheing and S3

Imager will always create and store the transformed images locally in your imagerSystemPath, even if you choose to upload and serve them from an external storage. The files in that folder acts as the ...
user avatar
  • 7,248
1 vote
Accepted

Element API, VueJs and Imager!

So the problem is that you're using an example from my older article, which was written for Craft 2.x. This line: craft()->config->set('generateTransformsBeforePageLoad', true); ...and also ...
user avatar
1 vote
Accepted

responsive image and srcset with Imager

It looks like the sizes attribute needs to be tweaked. Absolute image sizes need to be specified in px units, not w. <img src="{{ craft.imager.base64Pixel(16, 9) }}" sizes="(min-width:641px)...
user avatar
  • 2,573
1 vote

"A non-numeric value encountered" reintroduced after version 2.6.2991

The error appears to be coming from the Imager plugin: https://github.com/aelvan/Imager-Craft/blob/master/imager/services/ImagerService.php#L1025 Make sure you're using the latest version, and then ...
user avatar
1 vote
Accepted

How do I add a new item or object to an existing object?

When you use the Twig curly brace {}, key/value pair syntax like you've got imagerConfig set to, you're using the Twig hash literal. In Twig, if you want to add to an array or hash after it has ...
user avatar
  • 66.5k
1 vote

Can't seem to output fields related to the current category page

Specifically for the image, if I'm correct, you're trying to use imager the wrong way. It should be {% set image = entry.shopImage.first() %} {% set shopImageTransform = craft.imager....
user avatar
  • 701

Only top scored, non community-wiki answers of a minimum length are eligible