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

Sniff for getimagesize() #685

Open
davidsword opened this issue May 21, 2021 · 0 comments
Open

Sniff for getimagesize() #685

davidsword opened this issue May 21, 2021 · 0 comments

Comments

@davidsword
Copy link

davidsword commented May 21, 2021

What problem would the enhancement address for VIP?

getimagesize() holds up the PHP process downloading the entire image to just read its file size.

Describe the solution you'd like

Most images in WPs Media Library have width and height attributes already (like from wp_get_attachment_metadata()) & that existing data should be used instead.

If the image is external and not in WordPress' media library, perhapes:

What code should be reported as a violation?

$size = getimagesize( $image_url );
list($width, $height) = getimagesize( $image_url );
//etc.
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

1 participant