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

Add support for HEIC uploading + JPEG conversion #7034

Closed
Closed
Changes from 1 commit
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
bff5feb
Use setCompressionQuality when setting image quality
adamsilverstein Jul 9, 2024
619fb73
Add AVIF generated file size tests
adamsilverstein Jul 9, 2024
39c997a
Comment out setCompressionQuality calls to verify tests fail
adamsilverstein Jul 9, 2024
58b8c99
Improve AVIF tests
adamsilverstein Jul 9, 2024
ddf1b65
restore fixes
adamsilverstein Jul 10, 2024
722ddbf
reverse comparisons for assertLessThan
adamsilverstein Jul 11, 2024
ff5958f
space
adamsilverstein Jul 11, 2024
4719cf3
restore some text, separate out avif test
adamsilverstein Jul 12, 2024
0e5f559
restore previous test
adamsilverstein Jul 12, 2024
3db8e02
Add HEIC support
adamsilverstein Jul 15, 2024
b2df6ec
Add a default transform from HEIF to JPEG
adamsilverstein Jul 15, 2024
18f946c
revert tests/phpunit/tests/media.php to trunk
adamsilverstein Jul 16, 2024
81cc2f4
restore handlers.js from trunk
adamsilverstein Jul 16, 2024
a72ab72
update doc block
adamsilverstein Jul 16, 2024
230024d
revert changes from 61614
adamsilverstein Jul 16, 2024
db8ee37
remove additional 61614 changes
adamsilverstein Jul 16, 2024
9209a54
Update src/wp-includes/functions.php
adamsilverstein Jul 16, 2024
346d151
heif->heic
adamsilverstein Jul 16, 2024
683a076
Move heic upload support check to plupload_init filter
adamsilverstein Jul 16, 2024
9f5ead7
restore wp_show_heic_upload_error filtering
adamsilverstein Jul 16, 2024
bbbc2fe
heif->heic
adamsilverstein Jul 16, 2024
2314e65
Update src/wp-includes/media.php
adamsilverstein Jul 16, 2024
1fc680d
Update src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-c…
adamsilverstein Jul 16, 2024
694a747
one more heif->heic
adamsilverstein Jul 16, 2024
1de33cc
Shim PHP HEIC image size support with Imagick
adamsilverstein Jul 16, 2024
842e05d
Improve HEIC detection in wp_get_image_mime
adamsilverstein Jul 16, 2024
8b2009c
Ensure HEICs are enabled for wp_generate_attachment_metadata
adamsilverstein Jul 16, 2024
518500b
Merge branch 'trunk' into add/heic-support
adamsilverstein Jul 16, 2024
e1318bf
Yoda helps
adamsilverstein Jul 16, 2024
a2fc78c
Update src/wp-includes/media.php
adamsilverstein Jul 17, 2024
a65c937
One more HEIF->HEIC
adamsilverstein Jul 17, 2024
9d3fb9c
Merge branch 'add/heic-support' of github.com:adamsilverstein/wordpre…
adamsilverstein Jul 17, 2024
623593a
Add tests for wp_get_image_mime and wp_getimagesize
noisysocks Aug 1, 2024
f70771b
Add heic image to file_is_displayable_image test
noisysocks Aug 1, 2024
09078d1
Add test for resizing HEIC images
noisysocks Aug 1, 2024
5abb3a7
Split HEIC out of test_wp_getimagesize, skip when necessary
noisysocks Aug 1, 2024
ec4cb6a
Remove unnecessary foreach in test_wp_getimagesize_heic
noisysocks Aug 1, 2024
db78c27
De-duplicate call to image_editor_output_format filter
noisysocks Aug 2, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Improve AVIF tests
  • Loading branch information
adamsilverstein committed Jul 9, 2024
commit 58b8c993ac28d85afabe6bf89b503271064f780b
7 changes: 2 additions & 5 deletions tests/phpunit/tests/media.php
Original file line number Diff line number Diff line change
Expand Up @@ -5283,7 +5283,7 @@ public function test_quality_with_image_conversion_file_sizes() {
// The main (scaled) image: the JPEG should be smaller than the WebP.
$this->assertLessThan( $webp_sizes['filesize'], $jpeg_sizes['filesize'], 'The JPEG should be smaller than the WebP.' );

// Sub-sizes: for each size, the JPEGs should be smaller than the WebP.
// Sub-sizes: for each size, the WebP should be smaller than the JPEG.
$sizes_to_compare = array_intersect_key( $jpeg_sizes['sizes'], $webp_sizes['sizes'] );
foreach ( $sizes_to_compare as $size => $size_data ) {
$this->assertLessThan( $webp_sizes['sizes'][ $size ]['filesize'], $jpeg_sizes['sizes'][ $size ]['filesize'] );
Expand All @@ -5294,10 +5294,7 @@ public function test_quality_with_image_conversion_file_sizes() {
$avif_sizes = wp_generate_attachment_metadata( $attachment_id, $file );
remove_filter( 'image_editor_output_format', array( $this, 'image_editor_output_avif' ) );

// The main (scaled) image: the JPEG should be smaller than the AVIF.
$this->assertLessThan( $avif_sizes['filesize'], $jpeg_sizes['filesize'], 'The JPEG should be smaller than the AVIF.' );

// Sub-sizes: for each size, the JPEGs should be smaller than the AVIF.
// Sub-sizes: for each size, the AVIF should be smaller than the JPEG.
$sizes_to_compare = array_intersect_key( $jpeg_sizes['sizes'], $avif_sizes['sizes'] );
foreach ( $sizes_to_compare as $size => $size_data ) {
$this->assertLessThan( $avif_sizes['sizes'][ $size ]['filesize'], $jpeg_sizes['sizes'][ $size ]['filesize'] );
Expand Down
Loading