Opened 17 months ago
Last modified 2 weeks ago
#59764 new defect (bug)
GD squashes image for cropped size
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Future Release | Priority: | normal |
Severity: | normal | Version: | 6.3.3 |
Component: | Media | Keywords: | reporter-feedback |
Focuses: | Cc: |
Description
I have an image sub-size that uses crop instead of scale, and when the resulting image should upscale, GD does it OK-ish, Imagick is squashing the content.
In both cases, the resulting image has the expected width and height, but the content in the image generated with Imagick is not squashed. This happens for a portrait ratio of the original image.
How I replicate this:
- sub-size: 1440x760 px + crop
- original file: 1152x2048 px
- using the
image_resize_dimensions
filter that returns the upscaled computation - upload file using GD
- upload the same file using Imagick
GD result - OK
https://imgur.com/EQTesQT
Imagick result - not OK
https://imgur.com/G0hjmo0
Change History (12)
This ticket was mentioned in Slack in #core-media by antpb. View the logs.
12 months ago
#3
@
11 months ago
Hi @antpb!
Thanks for looking into this, it's been quite a while, and I had to redo my steps to replicate. The issue is still there in 6.5.2, but my initial comment is inaccurate, it's GD that produces the squashed image, Imagick does it well.
Please see my recording. For troubleshooting purposes, I implemented a small plugin that switches the editor class and also removes some image sizes, just to see generated the demo subsizes with the exact width and height.
I traced the issue down to the hook image_resize_dimensions
, this seems to do different things in GD vs. Imagick.
This is what I used in my example:
crop_landscape crop of 1700x930
crop_portrait crop of 930x1700
Source image and recording https://imgur.com/a/Fnui2CV
Let me know if I can assist with the troubleshooting.
Have a nice day,
Iulia
The site health info
`
### wp-core ###
version: 6.5.2
site_language: en_US
user_language: en_US
timezone: +00:00
permalink: /%postname%/
https_status: true
multisite: false
user_registration: 0
blog_public: 1
default_comment_status: open
environment_type: local
user_count: 1
dotorg_communication: true
### wp-paths-sizes ###
wordpress_path: /app/public
wordpress_size: 54.67 MB (57328731 bytes)
uploads_path: /app/public/wp-content/uploads
uploads_size: 14.53 MB (15239464 bytes)
themes_path: /app/public/wp-content/themes
themes_size: 12.12 MB (12706752 bytes)
plugins_path: /app/public/wp-content/plugins
plugins_size: 12.34 MB (12934728 bytes)
database_size: 2.70 MB (2834432 bytes)
total_size: 96.36 MB (101044107 bytes)
### wp-active-theme ###
name: Twenty Twenty-Four (twentytwentyfour)
version: 1.1
author: the WordPress team
author_website: https://wordpress.org
parent_theme: none
theme_features: core-block-patterns, post-thumbnails, responsive-embeds, editor-styles, html5, automatic-feed-links, widgets-block-editor, block-templates
theme_path: /app/public/wp-content/themes/twentytwentyfour
auto_update: Disabled
### wp-themes-inactive (2) ###
Twenty Twenty-Three: version: 1.4, author: the WordPress team, Auto-updates disabled
Twenty Twenty-Two: version: 1.7, author: the WordPress team, Auto-updates disabled
### wp-plugins-active (1) ###
Katla - Image Editor Switch: version: 1.0.0, author: Iulia Cazan, Auto-updates disabled
### wp-media ###
image_editor: WP_Image_Editor_Imagick
imagick_module_version: 1808
imagemagick_version: ImageMagick 7.1.0-46 Q16 aarch64 5ef3d4d66:20220816 https://imagemagick.org
imagick_version: 3.7.0
file_uploads: 1
post_max_size: 1000M
upload_max_filesize: 300M
max_effective_size: 300 MB
max_file_uploads: 20
imagick_limits:
imagick::RESOURCETYPE_AREA: 72 GB
imagick::RESOURCETYPE_DISK: 9.2233720368548E+18
imagick::RESOURCETYPE_FILE: 7872
imagick::RESOURCETYPE_MAP: 72 GB
imagick::RESOURCETYPE_MEMORY: 36 GB
imagick::RESOURCETYPE_THREAD: 1
imagick::RESOURCETYPE_TIME: 9.2233720368548E+18
imagemagick_file_formats: 3FR, 3G2, 3GP, AAI, AI, APNG, ART, ARW, ASHLAR, AVI, AVS, BAYER, BAYERA, BGR, BGRA, BGRO, BMP, BMP2, BMP3, BRF, CAL, CALS, CANVAS, CAPTION, CIN, CIP, CLIP, CMYK, CMYKA, CR2, CR3, CRW, CUBE, CUR, CUT, DATA, DCM, DCR, DCRAW, DCX, DDS, DFONT, DNG, DOT, DPX, DXT1, DXT5, EPDF, EPI, EPS, EPS2, EPS3, EPSF, EPSI, EPT, EPT2, EPT3, ERF, EXR, FARBFELD, FAX, FF, FILE, FITS, FL32, FLV, FRACTAL, FTP, FTS, FTXT, G3, G4, GIF, GIF87, GRADIENT, GRAY, GRAYA, GROUP4, GV, HALD, HDR, HISTOGRAM, HRZ, HTM, HTML, HTTP, HTTPS, ICB, ICO, ICON, IIQ, INFO, INLINE, IPL, ISOBRL, ISOBRL6, JNG, JNX, JPE, JPEG, JPG, JPS, JSON, K25, KDC, KERNEL, LABEL, M2V, M4V, MAC, MAP, MASK, MAT, MATTE, MEF, MIFF, MKV, MNG, MONO, MOV, MP4, MPC, MPEG, MPG, MRW, MSL, MSVG, MTV, MVG, NEF, NRW, NULL, ORA, ORF, OTB, OTF, PAL, PALM, PAM, PANGO, PATTERN, PBM, PCD, PCDS, PCL, PCT, PCX, PDB, PDF, PDFA, PEF, PES, PFA, PFB, PFM, PGM, PGX, PHM, PICON, PICT, PIX, PJPEG, PLASMA, PNG, PNG00, PNG24, PNG32, PNG48, PNG64, PNG8, PNM, POCKETMOD, PPM, PS, PS2, PS3, PSB, PSD, PTIF, PWP, QOI, RADIAL-GRADIENT, RAF, RAS, RAW, RGB, RGB565, RGBA, RGBO, RGF, RLA, RLE, RMF, RW2, SCR, SCT, SFW, SGI, SHTML, SIX, SIXEL, SPARSE-COLOR, SR2, SRF, STEGANO, STRIMG, SUN, SVG, SVGZ, TEXT, TGA, THUMBNAIL, TIFF, TIFF64, TILE, TIM, TM2, TTC, TTF, TXT, UBRL, UBRL6, UIL, UYVY, VDA, VICAR, VID, VIFF, VIPS, VST, WBMP, WEBM, WEBP, WMV, WPG, X3F, XBM, XC, XCF, XPM, XPS, XV, YAML, YCbCr, YCbCrA, YUV
gd_version: bundled (2.1.0 compatible)
gd_formats: GIF, JPEG, PNG, WebP, BMP
ghostscript_version: 9.56.1
### wp-server ###
server_architecture: Darwin 23.2.0 arm64
httpd_software: nginx/1.16.0
php_version: 8.1.23 64bit
php_sapi: fpm-fcgi
max_input_variables: 4000
time_limit: 1200
memory_limit: 524M
max_input_time: 600
upload_max_filesize: 300M
php_post_max_size: 1000M
curl_version: 8.4.0 (SecureTransport) LibreSSL/3.3.6
suhosin: false
imagick_availability: true
pretty_permalinks: true
htaccess_extra_rules: false
current: 2024-04-26T07:24:46+00:00
utc-time: Friday, 26-Apr-24 07:24:46 UTC
server-time: 2024-04-26T07:24:44+00:00
### wp-database ###
extension: mysqli
server_version: 8.0.16
client_version: mysqlnd 8.1.23
max_allowed_packet: 16777216
max_connections: 151
### wp-constants ###
WP_HOME: undefined
WP_SITEURL: undefined
WP_CONTENT_DIR: /app/public/wp-content
WP_PLUGIN_DIR: /app/public/wp-content/plugins
WP_MEMORY_LIMIT: 40M
WP_MAX_MEMORY_LIMIT: 524M
WP_DEBUG: false
WP_DEBUG_DISPLAY: true
WP_DEBUG_LOG: false
SCRIPT_DEBUG: false
WP_CACHE: false
CONCATENATE_SCRIPTS: undefined
COMPRESS_SCRIPTS: undefined
COMPRESS_CSS: undefined
WP_ENVIRONMENT_TYPE: local
WP_DEVELOPMENT_MODE: undefined
DB_CHARSET: utf8
DB_COLLATE: undefined
### wp-filesystem ###
wordpress: writable
wp-content: writable
uploads: writable
plugins: writable
themes: writable
`
This ticket was mentioned in Slack in #core-media by antpb. View the logs.
10 months ago
#5
@
10 months ago
- Milestone changed from 6.6 to 6.7
- Summary changed from Imagick squashes image for cropped size to GD squashes image for cropped size
Moving to 6.7 to allow us some time to investigate. Onward!
This ticket was mentioned in Slack in #core-media by antpb. View the logs.
8 months ago
#7
@
8 months ago
- Keywords reporter-feedback added
Hi @iulia-cazan ! We were reviewing this ticket again in the Media meeting and noticed that the site health report provided is using Imagick and not GD. Can you verify that this ticket title and description are still correct for this issue? Is it GD doing the squashing or Imagick? I know is been a while, but if you still have access to the environment this happens in please also provide the new site health report. Thanks so much!
This ticket was mentioned in Slack in #core by chaion07. View the logs.
5 months ago
#9
@
5 months ago
- Milestone changed from 6.7 to 6.8
Thanks @iulia-cazan for reporting this. We reviewed this Ticket during a recent bug-scrub session and based on the feedback received we feel the need to updating the milestone to 6.8 including the possibility of any contributor taking this forward possibly in time before 6.7 is released. However we would really appreciate if @iulia-cazan can follow up on the comments left by the core-media team and provide a much needed feedback.
Props to @khoipro
Cheers!
#10
@
4 months ago
Hi,
I wanted to follow up on this ticket. Since opening it, I’ve moved to a different machine and unfortunately haven’t been able to replicate the issue anymore. I’ve tested with the latest WordPress version as well as attempted to recreate the original environment (matching the PHP version and libraries), but the issue doesn’t occur. At this point, it’s unclear whether the problem was resolved in WordPress Core or was specific to the original setup. Please feel free to close this ticket if no further investigation is required.
Thank you for your time and support!
Best regards,
Iulia
Hi @iulia-cazan ! Is is possible for you to share the site health media information for the environment you are seeing the imagick resizing? Going to do some investigation into this and want to make sure we're aligned on versions. Thank you!
moving to 6.6 to investigate