Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do you handle derivative image path pattern(s) #24

Open
drzraf opened this issue Sep 18, 2019 · 1 comment
Open

How do you handle derivative image path pattern(s) #24

drzraf opened this issue Sep 18, 2019 · 1 comment

Comments

@drzraf
Copy link
Contributor

drzraf commented Sep 18, 2019

Hi, sorry for the support issue. I'm switching to Timmy and formalize my thumbnail size but hit a couple of issues.

I've an hundred of posts referencing derivative images (whether within ACF whether in the post_content). All these will break as a soon as I switch to Timmy (and regenerate thumbnails / purge old derivative files) because the filename pattern changes from, eg, image-A-300x252.png to image-A-300x0-c-default.png.

  1. It's far from future-proof, how do you handle this situation?
  2. Do you know about existing WP bugreports related to this (and the lack of an intermediary and height/width-agnostic representation of inlined images)?
  3. Is there a foolproof method/hook to store derivative images in completely different upload subfolder (to make identification of their references within the database easier)?
  4. And if yes, would you think using the format name instead of actual dimension for filename could be a realistic way to solve this, eg, image-A-medium.png?
@gchtr
Copy link
Member

gchtr commented Sep 23, 2019

Hey Raphaël!

No worries! I’m actually amazed there aren’t more support questions.

About your questions:

  1. Unfortunately, I’ve never a had a case like yours. But I’d like to make this work. Can you make more concrete examples for the images that break in the post content as well as for ACF? I would like to replicate this, so I can think about a solution.
  2. No, I don’t. But I didn’t go and dig in the trac tickets, either. What do you mean with «lack of an intermediary height/width-agnostic representation of inlined images»?
  3. Timmy relies on Timber’s resize function. I never tried to change the folders or filenames of the generated files, because apparently (from seeing a lot of issues in Timber) this leads to a lot special cases that need to be catched and handled separately. It’s far from foolproof and very fragile. I guess image handling in Timber could be improved. But there’s so much to consider. It’s really hard to come up with a solution that benefits everyone.
  4. We would have to explore this further. A benefit of the dimensions in the filename is that you can change dimensions and don’t have to regenerate all thumbnails, because the new size is generated on the fly. A downside is that you end up with invalid image sizes, so you would have to regenerate images anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants