Too large intrinsic thumbnails on mobile
-
Hi,
On mobile all thumbnails are loading too big intrinsic size on every page. On desktop all is ok.
f.i.:
on desktop thumbnails size is 275×275. rendered 275×275, intrinsic 280×280 because src and srcset is 280×280
on mobile thumbnails size is 188×188. rendered 188×188, intrinsic 580×580 but src and srcset is 280×280
So page size and loading time is way bigger then needed on mobile because it loads 580×580please check video:
https://www.loom.com/share/eec6c9b353da436ca5210188cacf00c6I already tried regenerate all thumbnails, changed theme, disabled all plugin etc.
- This topic was modified 2 years, 8 months ago by bramvds.
The page I need help with: [log in to see the link]
-
I understand your thumbnail specifications are not been followed.
Can you switch to the Storefront to see if that changes?
Hi,
I already tried regenerate all thumbnails, changed theme (including storefront), disabled all plugin etc.Hi @bramvds
Thanks for letting us know.
Seems this can be managed with some CSS. Can you please add this code under Custom > Edit Global CSS in the Customizer?
@media (max-width: 767px) { .woocommerce li.product .entry-featured img { max-height: 100% !important; width: auto; } }
Thanks, tried, but that does not work a bit.
i can give you credentials so you can see and try a little?
Hi I also had this problem, and maybe this could help
The thing is that it is not a bug. It actually works as it intend to do and that is to serve the best image according to the specific screen where the image is displayed.
I do hope that I explain this correct, if I’m not please correct me.
I guess you just like me wanted to improve the mobile speed and perhaps you run google page speed insight to find that it complain about image sizes on mobil. You dig deeper as you did and found that on mobile it actually downloads larger images than on desktop. Why is that? The WordPress functions to display the thumbnail uses srcset to serve the best possible image depending on screen size. So far so good. But when determine screen size it also look at the dpi, screen resolution. So if the screen is a Retina screen it doubles the width and instead it will pick a thumbnail double the size to be suitable for the retina screen. And with the newest iPhone that has even higher resolutions it will pick even larger images. But serving large images to mobile with high resolution screens will impact the page speed on mobiles and if you want to make a compromise you need a fix. In the code that you examine in the browser you see following: sizes=”(max-width: 280px) 100vw, 280px”. What it says is that if the screen max-width is 280px use an image with a width of 100% of the screen else use 280px. Now a retina screen is double the size so the comparison will be instead, if max width is 560px pick an image with a width of 100% of the screen and ofc it will pick an image that is larger than 280px. This is how you get larger images on mobile than on desktop. To really optimize this well to suite your site you need to learn about srcset and how it works. But just to help you with your problem to simply reduce images size on mobile you can put following code in your functions.php that will change the size attribute.
function my_post_thumbnail_sizes_attr( $attr, $attachment, $size ) {
$attr[‘sizes’] = ‘(max-width: 280px) 50vw, 280px’;
return $attr;
}
add_filter( ‘wp_get_attachment_image_attributes’, ’my_post_thumbnail_sizes_attr’, 10, 3 );What I have done is that I have change 100vw in the size attribute to 50 vw and that will half the size of the image since it will pick an image near the half the size of the width of the screen. Learning more about srcset and the size attribute you can refine this and customize it really well.
I hope this could help you./Mats
Thanks, tried, but that does not work a bit. Also thing is that you put thumbnail cropping at an aspect the images don’t have, the problem is gone.
But of course you don’t want different scaled imagesHi @bramvds,
I would recommend checking whether you have a caching plugin and then purging all cache from it. Can you also disable the cache on your host if you have any server-side caching enabled?
If the issue persists, please share the system status of your staging site and make sure you have switched to Storefront and have only WooCommerce core enabled. You can find it via WooCommerce > Status. Select “Get system report” and then “Copy for support”. Once you’ve done that, paste it here in your response.
Thanks.
already disabled everything, now only woocommerce and storefront active.
### WordPress Environment ### WordPress address (URL): https://woocommerce-466663-2283798.cloudwaysapps.com Site address (URL): https://woocommerce-466663-2283798.cloudwaysapps.com WC Version: 6.3.1 REST API Version: ? 6.3.1 WC Blocks Version: ? 6.9.0 Action Scheduler Version: ? 3.4.0 WC Admin Version: ? 3.2.1 Log Directory Writable: ? WP Version: 5.9.2 WP Multisite: – WP Memory Limit: 512 MB WP Debug Mode: – WP Cron: ? Language: nl_NL External object cache: – ### Server Environment ### Server Info: Apache/2.4.25 (Debian) PHP Version: 7.4.28 PHP Post Max Size: 50 MB PHP Time Limit: 500 PHP Max Input Vars: 5000 cURL Version: 7.52.1 OpenSSL/1.0.2u SUHOSIN Installed: – MySQL Version: 5.7.34-log Max Upload Size: 50 MB Default Timezone is UTC: ? fsockopen/cURL: ? SoapClient: ? DOMDocument: ? GZip: ? Multibyte String: ? Remote Post: ? Remote Get: ? ### Database ### WC Database Version: 6.3.1 WC Database Prefix: wp_ Total Database Size: 299.39MB Database Data Size: 168.59MB Database Index Size: 130.80MB wp_woocommerce_sessions: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_woocommerce_api_keys: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_woocommerce_attribute_taxonomies: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_woocommerce_downloadable_product_permissions: Data: 0.02MB + Index: 0.06MB + Engine InnoDB wp_woocommerce_order_items: Data: 1.52MB + Index: 0.41MB + Engine InnoDB wp_woocommerce_order_itemmeta: Data: 10.52MB + Index: 8.03MB + Engine InnoDB wp_woocommerce_tax_rates: Data: 0.02MB + Index: 0.06MB + Engine InnoDB wp_woocommerce_tax_rate_locations: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_woocommerce_shipping_zones: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_woocommerce_shipping_zone_locations: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_woocommerce_shipping_zone_methods: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_woocommerce_payment_tokens: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_woocommerce_payment_tokenmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_woocommerce_log: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_actionscheduler_actions: Data: 0.52MB + Index: 0.64MB + Engine InnoDB wp_actionscheduler_claims: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_actionscheduler_groups: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_actionscheduler_logs: Data: 0.36MB + Index: 0.28MB + Engine InnoDB wp_adtribes_my_conversions: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_berocket_termmeta: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_bv_fw_requests: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_bv_ip_store: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_bv_lp_requests: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_cartflows_ca_cart_abandonment: Data: 1.52MB + Index: 0.05MB + Engine InnoDB wp_cartflows_ca_email_history: Data: 0.06MB + Index: 0.06MB + Engine InnoDB wp_cartflows_ca_email_templates: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_cartflows_ca_email_templates_meta: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_commentmeta: Data: 0.28MB + Index: 0.28MB + Engine InnoDB wp_comments: Data: 9.52MB + Index: 9.09MB + Engine InnoDB wp_ee_products_sync_list: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_ee_product_sync_call: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_ee_product_sync_data: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_ee_product_sync_profile: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_ee_prouct_pre_sync_data: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_links: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_mclean_refs: Data: 1.52MB + Index: 0.00MB + Engine InnoDB wp_mclean_scan: Data: 0.06MB + Index: 0.02MB + Engine InnoDB wp_mollie_pending_payment: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_ms_snippets: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_nx_entries: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_nx_posts: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_nx_stats: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_options: Data: 6.39MB + Index: 1.14MB + Engine InnoDB wp_pay_options: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_pay_option_subs: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_pay_transactions: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_pmxe_exports: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_pmxe_google_cats: Data: 0.39MB + Index: 0.00MB + Engine InnoDB wp_pmxe_posts: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_pmxe_templates: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_postmeta: Data: 107.63MB + Index: 95.30MB + Engine InnoDB wp_posts: Data: 13.52MB + Index: 3.66MB + Engine InnoDB wp_rank_math_404_logs: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_rank_math_analytics_gsc: Data: 0.02MB + Index: 0.06MB + Engine InnoDB wp_rank_math_analytics_keyword_manager: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_rank_math_analytics_objects: Data: 0.23MB + Index: 0.11MB + Engine InnoDB wp_rank_math_internal_links: Data: 0.25MB + Index: 0.08MB + Engine InnoDB wp_rank_math_internal_meta: Data: 0.08MB + Index: 0.00MB + Engine InnoDB wp_rank_math_redirections: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_rank_math_redirections_cache: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_shortpixel_folders: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_shortpixel_meta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_smush_dir_images: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_snippets: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_social_users: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_termmeta: Data: 0.17MB + Index: 0.11MB + Engine InnoDB wp_terms: Data: 0.06MB + Index: 0.03MB + Engine InnoDB wp_term_relationships: Data: 1.52MB + Index: 1.52MB + Engine InnoDB wp_term_taxonomy: Data: 0.06MB + Index: 0.06MB + Engine InnoDB wp_tm_taskmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_tm_tasks: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_trp_dictionary_nl_nl_en_us: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_trp_gettext_nl_nl: Data: 0.20MB + Index: 0.14MB + Engine InnoDB wp_usermeta: Data: 4.52MB + Index: 4.03MB + Engine InnoDB wp_users: Data: 0.20MB + Index: 0.19MB + Engine InnoDB wp_wcpdf_invoice_number: Data: 0.16MB + Index: 0.00MB + Engine InnoDB wp_wcpdf_packing_slip_number: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wc_admin_notes: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wc_admin_note_actions: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wc_category_lookup: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wc_customer_lookup: Data: 0.31MB + Index: 0.19MB + Engine InnoDB wp_wc_download_log: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_wc_order_coupon_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_wc_order_product_lookup: Data: 1.52MB + Index: 0.50MB + Engine InnoDB wp_wc_order_stats: Data: 0.41MB + Index: 0.30MB + Engine InnoDB wp_wc_order_tax_lookup: Data: 0.25MB + Index: 0.20MB + Engine InnoDB wp_wc_product_attributes_lookup: Data: 1.52MB + Index: 2.02MB + Engine InnoDB wp_wc_product_meta_lookup: Data: 1.52MB + Index: 0.80MB + Engine InnoDB wp_wc_rate_limits: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wc_reserved_stock: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wc_tax_rate_classes: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wc_webhooks: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wdp_orders: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_wdp_order_items: Data: 0.02MB + Index: 0.06MB + Engine InnoDB wp_wdp_persistent_rules_cache: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wdp_rules: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_wdr_order_discounts: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wdr_order_item_discounts: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wdr_rules: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_woobe_history: Data: 0.06MB + Index: 0.05MB + Engine InnoDB wp_woobe_history_bulk: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_woocommerce_bundled_itemmeta: Data: 0.22MB + Index: 0.22MB + Engine InnoDB wp_woocommerce_bundled_items: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_wpfm_backup: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wpforms_tasks_meta: Data: 0.06MB + Index: 0.00MB + Engine InnoDB wp_yith_wcwl: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_yith_wcwl_lists: Data: 0.02MB + Index: 0.05MB + Engine InnoDB ### Post Type Counts ### attachment: 3863 blocks: 29 br_labels: 1 cartflows_flow: 1 cartflows_step: 2 custom_css: 1 customize_changeset: 14 language_switcher: 3 nav_menu_item: 93 oembed_cache: 20 page: 23 post: 28 postman_sent_mail: 250 product: 1209 product_variation: 3076 revision: 109 shop_order: 4793 shop_order_refund: 415 sidebar: 3 wafs: 1 wof_lite_wheel: 1 wp_global_styles: 1 wpforms: 3 ### Security ### Secure connection (HTTPS): ? Hide errors from visitors: ? ### Active Plugins (1) ### WooCommerce: by Automattic – 6.3.1 ### Inactive Plugins (42) ### Advanced Dynamic Pricing for WooCommerce: by AlgolPlus – 4.0.4 Antispam Bee: by pluginkollektiv – 2.11.0 BEAR – Bulk Editor and Products Manager Professional for WooCommerce: by realmag777 – 2.1.1 Better Search Replace: by Delicious Brains – 1.3.4 Billink - Achteraf Betalen: by Tussendoor internet & marketing – 2.1.4 Bopo - WooCommerce Product Bundle Builder Premium: by VillaTheme – 1.0.2 bunny.net: by bunny.net – 1.0.8 CartFlows: by CartFlows Inc – 1.8.2 Classic Editor: by WordPress Contributors – 1.6.2 Code Snippets: by Code Snippets Pro – 2.14.3 Definitely allow mobile zooming: by Kybernetik Services – 1.6.0 Filester - File Manager Pro: by Ninja Team – 1.7.4 Gutenberg Blocks and Template Library by Otter: by ThemeIsle – 2.0.1 Lazy Load - Optimize Images: by WP Rocket – 2.3.4 Loco Translate: by Tim Whitlock – 2.6.0 Mollie Payments for WooCommerce: by Mollie – 7.0.2 Nextend Social Login: by Nextendweb – 3.1.4 Payment Gateway Based Fees and Discounts for WooCommerce: by Tyche Softwares – 2.6.4 Post SMTP: by Yehuda Hassine – 2.0.24 Product Feed PRO for WooCommerce: by AdTribes.io – 11.4.1 Rank Math SEO: by Rank Math – 1.0.84 Regenerate Thumbnails: by Alex Mills (Viper007Bond) – 3.1.5 Safe SVG: by 10up – 1.9.10 ShortPixel Image Optimizer: by ShortPixel – 4.22.8 Ultimate Addons for Gutenberg: by Brainstorm Force – 1.25.4 WebP Converter for Media: by Mateusz Gbiorczyk – 4.2.4 WooCommerce Cart Abandonment Recovery: by CartFlows Inc – 1.2.13 WooCommerce NL Postcode Checker: by Ewout Fernhout – 2.8.3 WooCommerce Parcel Pro: by Parcel Pro – 1.5.36 WooCommerce PDF Invoices & Packing Slips: by WP Overnight – 2.14.0 WooCommerce Pixel Manager: by SweetCode – 1.14.3 WooCommerce Product Variations Swatches Premium: by VillaTheme – 1.0.5 WooCommerce Weight Based Shipping: by weightbasedshipping.com – 5.3.19 WooCommerce Wholesale Prices: by Rymera Web Co – 2.0.1 Woo Discount Rules: by Flycart – 2.3.13 WooSidebars: by WooCommerce – 1.4.6 WP-Optimize - Clean, Compress, Cache: by David Anderson Ruhani Rabin Team Updraft – 3.2.3 WPC Product Bundles for WooCommerce (Premium): by WPClever – 6.0.8 WP Crontrol: by John Blackbourn & crontributors – 1.12.0 WPC Variations Radio Buttons for WooCommerce (Premium): by WPClever – 3.0.1 WP File Manager: by mndpsingh287 – 7.1.4 WPForms Lite: by WPForms – 1.7.2.1 ### Settings ### API Enabled: ? Force SSL: ? Currency: EUR (€) Currency Position: left Thousand Separator: . Decimal Separator: , Number of Decimals: 2 Taxonomies: Product Types: bopobb (bopobb) bundle (bundle) external (external) grouped (grouped) simple (simple) variable (variable) woosb (woosb) Taxonomies: Product Visibility: exclude-from-catalog (exclude-from-catalog) exclude-from-search (exclude-from-search) featured (featured) outofstock (outofstock) rated-1 (rated-1) rated-2 (rated-2) rated-3 (rated-3) rated-4 (rated-4) rated-5 (rated-5) Connected to WooCommerce.com: – ### WC Pages ### Shop base: #63 - /shop/ Cart: #62 - /winkelmand/ Checkout: #61 - /afrekenen/ My account: #60 - /my-account/ Terms and conditions: #303 - /algemene-voorwaarden/ ### Theme ### Name: Storefront Version: 4.0.0 Author URL: https://woocommerce.com/ Child Theme: ? – If you are modifying WooCommerce on a parent theme that you did not build personally we recommend using a child theme. See: How to create a child theme WooCommerce Support: ? ### Templates ### Overrides: – ### Action Scheduler ### Complete: 1,778 Oldest: 2022-02-17 11:02:27 +0100 Newest: 2022-03-18 09:34:43 +0100 Pending: 2 Oldest: 2022-03-20 07:09:55 +0100 Newest: 2022-03-20 07:09:55 +0100 ### Status report information ### Generated at: 2022-03-18 09:38:12 +01:00
Once the theme was changed, the responsiveness should have been corrected. Can you deactivate and reactivate WooCommerce?
Can you have your host clear your server/site cache?
Also, could there be some additional CSS influencing this in Appearance > Customize > Additional CSS?
We look forward to hearing from you.
deactivated and activated woocommerce, no additional css.
as you can see on the homepage, on mobile it still loading way too big thumbnail (650×650), cache on server is cleared.Hello,
Thanks for confirming!
I’ve checked your staging site using Firefox in two mobile phones with very different screen resolutions: an iPhone 6S and a Samsung Galaxy S8+.
The iPhone loaded this image: https://woocommerce-466663-2283798.cloudwaysapps.com/wp-content/uploads/2016/03/ram-o-staande-bokszak-bokspaal-324×324.jpg
While the Samsung loaded this one: https://woocommerce-466663-2283798.cloudwaysapps.com/wp-content/uploads/2016/03/ram-o-staande-bokszak-bokspaal.jpg
It looks like the site is serving images that are adequate for the device’s screen resolution.
I suggest you try a user agent switcher browser extension for further testing. It will present your site with the appropriate user agent string for the device you are trying to emulate.
Hope this helps!
Thanks i know, but still:
if i use crop thumbnail image for woocommerce products with a different ratio then the uploaded image (which are all 1:1), like 5:6 all is ok, and no problem on any mobile.
And also pagespeed insight is telling me to deliver images in the correct size for mobile.Hi @bramvds,
It seems we can’t help much here as issues related to mobile responsiveness specific to your setup can’t be considered within our scope of support. You could ask a developer to take a look at it. If you don’t have a go-to developer, check out the services on our customizations page.
I’m going to close this thread now but if you have any specific questions on WooCommerce core feel free to open a new topic.
Best regards.
For sure it not my setup. A clean install with wordpress woocommerce storefront will replicate this. So why close it?
- The topic ‘Too large intrinsic thumbnails on mobile’ is closed to new replies.