-
Notifications
You must be signed in to change notification settings - Fork 142
Closed
Labels
[Plugin] Modern Image FormatsIssues for the Modern Image Formats plugin (formerly WebP Uploads)Issues for the Modern Image Formats plugin (formerly WebP Uploads)[Type] BugAn existing feature is brokenAn existing feature is broken
Milestone
Description
Hi, in picture element I have wrong AVIF image with resolution 768x768px.
How to reproduce
- Add to php
add_image_size( 'square', 768, 768, true );
add_filter( 'pre_option_medium_size_h', function() { return '768'; } );
add_filter( 'pre_option_medium_size_w', function() { return '512'; } );
add_filter( 'pre_option_medium_crop', function() { return array( 'center', 'center' ); } );- Upload image to Media Library
- in template call
wp_get_attachment_image( $post_thumbnail_id, 'medium', false ); - give me WRONG size in SOURCE element =>
<picture>
<source data-sizes="auto, (max-width: 768px) 100vw, 768px" data-srcset="gku6acxnr_a-768x768-jpg.avif 768w, gku6acxnr_a-1152x768-jpg.avif 1152w, gku6acxnr_a-1536x1024-jpg.avif 1536w, gku6acxnr_a-150x100-jpg.avif 150w, gku6acxnr_a-jpg.avif 1600w" type="image/avif" >
<img data-sizes="auto, (max-width: 768px) 100vw, 768px" data-src="gku6acxnr_a-768x512.jpg" data-srcset="gku6acxnr_a-768x512.jpg 768w, gku6acxnr_a-1152x768.jpg 1152w, gku6acxnr_a-1536x1024.jpg 1536w, gku6acxnr_a-150x100.jpg 150w, gku6acxnr_a.jpg 1600w" width="768" height="512" src="//:0" class="lazyload" alt="gku6acxnr a" decoding="async" loading="lazy" data-has-transparency="false" data-dominant-color="9b6e44" style="--dominant-color: #9b6e44;" />
</picture>- In function
webp_uploads_wrap_image_in_picture()I have array size_array =>
print_r( $size_array );
[image/jpeg] => Array
(
[w] => Array
(
[1600] => Array
(
[file] => gku6acxnr_a.jpg
[filesize] => 346046
)
[768] => Array
(
[file] => gku6acxnr_a-768x768.jpg
[filesize] => 90049
)
[150] => Array
(
[file] => gku6acxnr_a-150x100.jpg
[filesize] => 6883
)
[1152] => Array
(
[file] => gku6acxnr_a-1152x768.jpg
[filesize] => 126075
)
[1536] => Array
(
[file] => gku6acxnr_a-1536x1024.jpg
[filesize] => 216081
)
[384] => Array
(
[file] => gku6acxnr_a-384x384.jpg
[filesize] => 29420
)
)
[h] => Array
(
[1067] => Array
(
[file] => gku6acxnr_a.jpg
[filesize] => 346046
)
[512] => Array
(
[file] => gku6acxnr_a-768x512.jpg
[filesize] => 62979
)
[150] => Array
(
[file] => gku6acxnr_a-150x150.jpg
[filesize] => 8625
)
[768] => Array
(
[file] => gku6acxnr_a-768x768.jpg
[filesize] => 90049
)
[1024] => Array
(
[file] => gku6acxnr_a-1536x1024.jpg
[filesize] => 216081
)
[384] => Array
(
[file] => gku6acxnr_a-384x384.jpg
[filesize] => 29420
)
[100] => Array
(
[file] => gku6acxnr_a-150x100.jpg
[filesize] => 6883
)
)
)
[image/avif] => Array
(
[w] => Array
(
[1600] => Array
(
[file] => gku6acxnr_a-jpg.avif
[filesize] => 262685
)
[768] => Array
(
[file] => gku6acxnr_a-768x768-jpg.avif
[filesize] => 75746
)
[150] => Array
(
[file] => gku6acxnr_a-150x100-jpg.avif
[filesize] => 4278
)
[1152] => Array
(
[file] => gku6acxnr_a-1152x768-jpg.avif
[filesize] => 104232
)
[1536] => Array
(
[file] => gku6acxnr_a-1536x1024-jpg.avif
[filesize] => 184244
)
[384] => Array
(
[file] => gku6acxnr_a-384x384-jpg.avif
[filesize] => 24190
)
)
[h] => Array
(
[1067] => Array
(
[file] => gku6acxnr_a-jpg.avif
[filesize] => 262685
)
[512] => Array
(
[file] => gku6acxnr_a-768x512-jpg.avif
[filesize] => 49628
)
[150] => Array
(
[file] => gku6acxnr_a-150x150-jpg.avif
[filesize] => 6105
)
[768] => Array
(
[file] => gku6acxnr_a-768x768-jpg.avif
[filesize] => 75746
)
[1024] => Array
(
[file] => gku6acxnr_a-1536x1024-jpg.avif
[filesize] => 184244
)
[384] => Array
(
[file] => gku6acxnr_a-384x384-jpg.avif
[filesize] => 24190
)
[100] => Array
(
[file] => gku6acxnr_a-150x100-jpg.avif
[filesize] => 4278
)
)
)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
[Plugin] Modern Image FormatsIssues for the Modern Image Formats plugin (formerly WebP Uploads)Issues for the Modern Image Formats plugin (formerly WebP Uploads)[Type] BugAn existing feature is brokenAn existing feature is broken
Type
Projects
Status
Done 😃