Timeline for Create image formats with different qualities when uploading
Current License: CC BY-SA 3.0
17 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jul 1, 2017 at 11:26 | comment | added | Christine Cooper♦ | This is very nice birgire and you know it! I will post an update in the other thread shortly. | |
Jun 30, 2017 at 17:26 | comment | added | birgire | Please check the update, hope you can adjust to your needs @ChristineCooper | |
Jun 30, 2017 at 17:26 | history | edited | birgire | CC BY-SA 3.0 |
Update for WPSE2_Image_Editor_GD
|
Jun 30, 2017 at 13:23 | comment | added | Christine Cooper♦ |
@birgire Is there any way to do a if ($image_size == 'name') instead of if( $size['height'] <= 150 && $size['width'] <= 150 ) ? I am aware that I can manually add the width/height of each image size in an if & elseif statement but it might not be ideal for readability. Maybe we could do a get_intermediate_image_sizes() and then set it that way? Although we need to know which is the current image size that is being processed.
|
|
Jun 24, 2017 at 22:38 | history | edited | birgire | CC BY-SA 3.0 |
Some light adjustments
|
Jun 24, 2017 at 22:31 | history | edited | birgire | CC BY-SA 3.0 |
Some light adjustments
|
Oct 21, 2014 at 18:53 | comment | added | Staffan Estberg | Cool. Good to know! :) | |
Oct 21, 2014 at 11:41 | history | bounty ended | CommunityBot | ||
Oct 21, 2014 at 8:56 | comment | added | birgire |
I almost managed to solve this with only filters (intermediate_image_sizes_advanced , image_resize_dimensions and jpeg_quality filter) within a custom class, but was stopped by single line in the get_quality() method of the WP_Image_Editor class. It's the check: if ( ! $this->quality ) , that's made before the jpeg_quality filter is activated. That means you can only use that filter once, for all intermediate jpeg image sizes. So if we want to modify the quality before the files are saved, then I don't see another way then to extend the class as I did in my answer ;-)
|
|
Oct 14, 2014 at 9:38 | history | edited | birgire | CC BY-SA 3.0 |
deleted 1 character in body
|
Oct 13, 2014 at 19:04 | comment | added | Staffan Estberg | Ok. Thanks for the heads up though. | |
Oct 13, 2014 at 17:36 | history | edited | birgire | CC BY-SA 3.0 |
added 229 characters in body
|
Oct 13, 2014 at 16:25 | comment | added | birgire | @StaffanEstberg It looks like the answer I linked to only applies to the image editor, but not when you upload the image. | |
Oct 13, 2014 at 16:11 | comment | added | birgire | @StaffanEstberg It looks like this answer is a much better solution, but I haven't tested it ;-) | |
Oct 13, 2014 at 15:00 | vote | accept | Staffan Estberg | ||
Oct 13, 2014 at 15:00 | comment | added | Staffan Estberg | Wow, what a thorough and nicely explained idea. Thanks birgire! While I did go for the solution kraftner suggested I will definitively try this out. | |
Oct 13, 2014 at 14:30 | history | answered | birgire | CC BY-SA 3.0 |