Automattic / themes

Free WordPress themes made by Automattic for WordPress.org and WordPress.com.
https://themeshaper.com
GNU General Public License v2.0
901 stars 357 forks source link

Orvis: Problems with image scaling/zoom due to theme's `crop` value #631

Open azollafox opened 5 years ago

azollafox commented 5 years ago

Steps to replicate.

  1. Upload a good looking GIF gif (Image link: https://brittafockecom.files.wordpress.com/2018/09/corporate-design-tausch-mahl2.gif )

  2. Use the GIF as a featured image in a portfolio.

Result

he GIF now looks very low quality. bad gif

(Image link: https://brittafockecom.files.wordpress.com/2018/09/corporate-design-tausch-mahl2.gif?w=292&h=153&crop=1 )

Expected

The GIF should look the same

The issue was reported here https://github.com/Automattic/jpop-issues/issues/3403

@mdawaffe commented that

 It's not being sized correctly because files.wordpress.com's `crop=1` (supplied by Orvis) is not compatible with `zoom` (used by devicepx.js to use the best image size possible).

See:
* https://jetpackp2.wordpress.com/2017/06/22/image-compression-on-davidtejerotattoos-com/#comment-29940
* https://devopsp2.wordpress.com/2017/08/10/moving-away-from-photonized-wpcom-hosted-images/#comment-1764

It may be possible for Orvis to stop using the `crop` parameter for these images:

diff
Index: functions.php
===================================================================
--- functions.php   (revision 53229)
+++ functions.php   (working copy)
@@ -42,7 +42,7 @@
     */
    add_theme_support( 'post-thumbnails' );
    set_post_thumbnail_size( 924, 0, true );
-   add_image_size( 'orvis-project-thumbnail', 671, 0, true );
+   add_image_size( 'orvis-project-thumbnail', 671, 0 );

    // Enable support for custom logo.
    add_theme_support( 'custom-logo', array(

I *think* that the the `crop: true` specified for `orvis-project-thumbnail` is unimportant since the height is set to `0` (meaning we will always "crop" to the original image's aspect ratio anyway), though I'm not totally sure.
azollafox commented 5 years ago

User follow up is needed at 1830750-zen

NoHopeRadio commented 2 years ago

Just reporting another iteration of this, several years later: #33602178-hc

Although in this case, the cropped version isn't loading at all.

github-actions[bot] commented 2 years ago

As a part of this repository’s maintenance, this issue is being marked as stale due to inactivity. Please feel free to comment on it in case we missed something.