Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[4.x]: Image Transformation Error on Cropping #13884

Closed
magnessjo opened this issue Oct 27, 2023 · 3 comments
Closed

[4.x]: Image Transformation Error on Cropping #13884

magnessjo opened this issue Oct 27, 2023 · 3 comments
Assignees

Comments

@magnessjo
Copy link
Contributor

magnessjo commented Oct 27, 2023

What happened?

Description

craft\services\Images::loadImage(): Argument #3 ($svgSize) must be of type int, null given, called in /imagetransforms/ImageTransformer.php on line 668

I can provide access to a staging instance through email if needed or a video capture.

Steps to reproduce

  1. Base Craft install with Servd assets platform V3
  2. User tried to crop an asset

Expected behavior

Cropped image is saved.

Actual behavior

Error throw

Craft CMS version

Craft Pro 4.5.9

PHP version

8.2.10

Operating system and version

Servd Platform - Linux distro but not sure which one

Database type and version

Mysql 8

Image driver and version

GD 8.2.10 locally but assume Servd is using Imagemagick

Installed plugins and versions

Feed Me | 5.2.0
Neo | 3.9.8
Postmark | 3.0.0
Redactor | 3.0.4
Retour | 4.1.14
SEOmatic | 4.0.33
Servd Assets and Helpers | 3.5.2
Super Table | 3.0.12

@i-just
Copy link
Contributor

i-just commented Oct 30, 2023

Hi, thanks for getting in touch!

This will happen if the asset width and height are set to null in the database. That, in turn, can happen if, e.g. the image is too large for ImageMagick to handle (for example, like described here: #13687).

You could run asset reindexing (Control Panel > Utilities > Asset Indexes or via terminal) to attempt to get the right sizes for the images.

I raised a PR to make this code a bit more forgiving, and I’ll be looking at #13687 to try to improve dimension detection and storage.

@magnessjo
Copy link
Contributor Author

Hi @i-just, Thank you for the guidance.

We have conveyed the issue to our authors and provided them with resources for reducing image sizes.

I appreciate the PR.

@brandonkelly
Copy link
Member

Craft 4.5.10 is out with a couple improvements related to this / #13687.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants