WordPress.org

Plugin Directory

jetpack

Opened 5 years ago

Closed 4 years ago

#1766 closed defect (duplicate)

Photon doesn't recognize images using a filename similar to WordPress' default resized images

Reported by: jeherve Owned by: tmoorewp
Priority: normal Severity: normal
Plugin: jetpack Keywords: photon
Cc: jeherve, aaroncampbell, PeteMall, richard@…

Description

Steps to reproduce:

  1. Activate Jetpack and Photon on your site
  2. Upload and insert an image in a new post, using the following filename:

my-image-500x500.jpg

  1. Publish your post.

If we don't get a response when querying for the "original image", we should try to load the resized image instead.

Reported here:

Attachments (2)

1766.diff (3.7 KB) - added by georgestephanis 4 years ago.
Not sure if this is the best implementation here, but figured I'd get it out into the world.
1766.1.diff (4.0 KB) - added by georgestephanis 4 years ago.
Whoops, forgot to include the tweak to Jetpack_Options to let it check.

Download all attachments as: .zip

Change History (11)

comment:1 @aaroncampbell5 years ago

  • Cc aaroncampbell added

comment:2 @PeteMall5 years ago

  • Cc PeteMall added

comment:4 @aaroncampbell4 years ago

The solution seems to be:

  1. Check that the file exists before sending it to Photon - This one can be done in the plugin itself and if you don't want to check for the actual file, you could check the DB to see if a file with that name SHOULD exist.
  2. Pass both image names to the Photon service and have the service try the first and fall back to the second.

comment:5 @richardmtl4 years ago

  • Cc richard@… added

@georgestephanis4 years ago

Not sure if this is the best implementation here, but figured I'd get it out into the world.

comment:7 @georgestephanis4 years ago

Aaron -- just uploaded a patch I've been holding onto and pondering on for a while. I'm not quite certain this is the best way to do it on the "check that it exists first" front -- happy for suggestions or feedback.

@georgestephanis4 years ago

Whoops, forgot to include the tweak to Jetpack_Options to let it check.

comment:9 @jeherve4 years ago

  • Resolution set to duplicate
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.