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

Update WordPress core functions to support multiple mime types #155

Open
Tracked in #22
mitogh opened this issue Feb 7, 2022 · 9 comments
Open
Tracked in #22

Update WordPress core functions to support multiple mime types #155

mitogh opened this issue Feb 7, 2022 · 9 comments

Comments

@mitogh
Copy link
Member

@mitogh mitogh commented Feb 7, 2022

Feature Description

Functions such as:

  • wp_get_attachment_image_src
  • wp_get_attachment_image_srcset
  • wp_get_attachment_image_url

Should be updated in order to support an additional parameter or to update the icon parameter in some cases to behave as mime type support parameter. This parameter would allow specifying the desired mime type for an image in case we want to render the JPEG, WebP, Avif or any other available mime type for an image based on the specified image size.

This is a subsequent step on the work for:

@eclarke1
Copy link

@eclarke1 eclarke1 commented Feb 8, 2022

@mitogh assigning this to you if you agree as it relates so closely to #142 and #149 where you're already working

@mitogh
Copy link
Member Author

@mitogh mitogh commented Feb 8, 2022

Sounds good to me I'm assigning @jjgrainger as well to help with the collection of functions

@adamsilverstein
Copy link
Member

@adamsilverstein adamsilverstein commented Feb 14, 2022

I'm also going to start looking at this based on the data stored in #154 #147

@jjgrainger
Copy link

@jjgrainger jjgrainger commented Mar 4, 2022

I am working on a proposal as to what changes are to be made. The WIP document is available here and open to early feedback.

@jjgrainger
Copy link

@jjgrainger jjgrainger commented Mar 8, 2022

The proposal for this is complete and open to feedback. Document is here.

The proposal is to add an additional $mime_type parameter to existing WordPress core functions to request a specific mime type for the attachment.

If the requested mime type is not available, other mime types will be checked for and eventually falling back to the attachments original mime type. A filter to define this order is being discussed in #187

@mitogh mitogh removed their assignment Mar 9, 2022
@mitogh
Copy link
Member Author

@mitogh mitogh commented Mar 10, 2022

Thanks @jjgrainger the document looks solid and defines a clear path moving forward.

I'd suggest we can summarize the 3 options and share them during the next call on Tuesday so the rest of the community can provide any concerns/feedback or vote on the different approaches, but let me know what you think about that @adamsilverstein @bethanylang @jjgrainger .

@bethanylang
Copy link

@bethanylang bethanylang commented Mar 10, 2022

@mitogh That makes sense to me, but @adamsilverstein and @felixarntz, please confirm.

@jjgrainger Once you would summarize the options on next week's chat, I can 1) drop a comment for voting here with those summaries and ask folks to leave an emoji for whichever option they'd prefer, 2) add a Needs Decision label, and 3) set a deadline for voting, which is typically two weeks from vote start.

@felixarntz
Copy link
Member

@felixarntz felixarntz commented Mar 10, 2022

@jjgrainger @mitogh @bethanylang I think this topic is a bit too close to code to efficiently discuss in the chat meeting. I'd say we should rather encourage providing more feedback on the doc. Maybe we can just leave a message in the channel anytime today sharing the doc and asking for feedback and preferred approach?

I'm going to have a look today as well. @adamsilverstein Can you please review this doc too? It would be crucial since it closely affects your core patch work.

On that note, I don't think this issue will require any plugin engineering since it's all related to the WP core implementation. That may be obvious, but I certainly wanted to clarify.

@jjgrainger
Copy link

@jjgrainger jjgrainger commented Mar 14, 2022

Thanks all,

Just wanted to provide an overview of the document shared last week. We are looking to update WordPress core functions to provide a means to retrieve a specific mime type for an attachment.

We're currently exploring 3 options, with a potential fourth that combines some of these. The current 3 within the document are:

  • Updating the $icon attribute in core functions to accept a mime type value
  • Updating core functions with an additional $mime_type parameter
  • Creating new core functions to work with attachment mime types

These options and others are currently being explored and discussed in the document. This document is open to everyone and welcome to feedback and suggestions on a preferred approach.

If you have anything you want to add please leave all feedback in the document.

I have left a message in the channel also requesting feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
[Focus] Images
In progress
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
6 participants