Make WordPress Core

Opened 4 years ago

Last modified 14 months ago

#42922 new defect (bug)

Image Scaling using get_the_post_thumbnail issue in WordPress

Reported by: rigids.php Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.9.1
Component: Media Keywords:
Focuses: Cc:


Issue URL - http://www.creativescripters.com/clients/testwp/uncategorized/image-resized/

I am using wordpress (self hosted) latest version, The problem is I am looking to get a thumbnail from the resized/scaled image, and when I do that wordpress returns the test-150x150.jpg i.e. Thumbnail from the original image and not the resized image which should have been test-e1513229707262-150x150.jpg

Step to reproduce the issue

  1. Upload an image , Scale it (click edit on uploaded image and change width and click scale). Wordpress will rename the image and add an Suffix Id to the name so you can confirm the image have been scaled. for eg if you uploaded test.jpg after scaling image name will become test-randomstring.jpg

[![enter image description here][1]][1]

  1. When I call get_the_post_thumbnail($post, 'full') I get the correct image The resized one i.e. test-randomstring.jpg [![enter image description here][2]][2]
  1. When I try to get a different size of the scaled image for eg I need thumbnail generated from the image size and I call function get_the_post_thumbnail($post, 'thumbnail') wordpress return the THUMBNAIL from actual image (the one I uploaded initially test.jpg and not the resized one test-randomstring.jpg)

Screenshot - https://i.imgur.com/sQKoZcF.png

[1]: https://i.stack.imgur.com/TTIaG.png
[2]: https://i.stack.imgur.com/T3vPE.png

Change History (3)

#1 @markparnell
20 months ago

  • Component changed from General to Media
  • Summary changed from Image Scaling using get_the_post_thumbnail issue in Wordpress to Image Scaling using get_the_post_thumbnail issue in WordPress

This ticket was mentioned in Slack in #core-media by sabernhardt. View the logs.

14 months ago

#3 @sabernhardt
14 months ago

#49080 was marked as a duplicate.

Note: See TracTickets for help on using tickets.