Make WordPress Core

Opened 10 years ago

Last modified 5 years ago

#26848 assigned defect (bug)

Image thumbnail on large images with ratio of 4:1

Reported by: nathan_dawson's profile nathan_dawson Owned by: markoheijnen's profile markoheijnen
Milestone: Priority: normal
Severity: minor Version: 3.8
Component: Media Keywords: needs-patch needs-testing
Focuses: Cc:

Description

I have been running into this issue on WordPress 3.7.1 and 3.8. I haven't tested it in older versions.

I'm uploading an image that's 2000px x 500px.

The theme uses add_image_size for a variety of different thumbnail sizes but the only one that's an issue is 480px.

The URL to the thumbnail is being retrieved with wp_get_attachment_image_src( $thumbnail_id, 'mobile' ) for use with some CSS. Chrome is recognising it as a 1px x 1px image with a MIME type of image/png. When you open the image URL it appears correctly.

Steps to reproduce:

add_image_size( 'mobile', 480, 0, true ); in functions.php
Upload a blank image at 2000px x 500px

I also found in Chrome that when going to my uploads folder and selecting the image that's 480px x 120px I can't save the image with CMD SHIFT S yet I can with any of the other images.

I have tried removing all plugins and using the default theme. The only modification I made was to add the image size.

I changed the image library from libgd to imagemagick.

Changing the image size from 480px to 479px works.

Change History (5)

#1 @markoheijnen
10 years ago

You have this issue with GD and with Imagemagick? Also is the one that fails the only one with height 0? I will check it out tomorrow.

Curious why suddenly two related tickets showed up. See #26846.

#2 @nathan_dawson
10 years ago

Yes it's with both. I tried uploading both a jpg and a png and same problem. All other image sizes I'm using have a height of 0 as well.

It seemed like a localhost issue at first but I've tried on 2 different servers.

#3 @wonderboymusic
10 years ago

  • Milestone changed from Awaiting Review to Future Release
  • Owner set to markoheijnen
  • Status changed from new to assigned

markoheijnen, 9 months ago: "I will check it out tomorrow."

The future is now.

#4 @markoheijnen
10 years ago

I believe I did tested it then and couldn't reproduce it. I just tried on 3.8 and 4.0 and still unsure how to reproduce the steps. Will start trying other image sizes and also test 3.7.1.

nathan_dawson: Can you try to reproduce again and upload the image where it did happen with?

#5 @chriscct7
8 years ago

  • Keywords needs-patch needs-testing added
Note: See TracTickets for help on using tickets.