Releases: junaidbhura/fly-dynamic-image-resizer
Fix error for WP_Filesystem in some cases
Fix error for WP_Filesystem when deleting an image in some edge cases. More info: #46
Fix file extensions in edge cases
Fixed file extension case when the files are imported in uppercase. More info: #38
New filter for image paths
Added a new filter fly_attached_file
More info: #33
/**
* Fly Attached File
*
* @param string $attached_file
* @param integer $attachment_id
* @param mixed $size
* @param boolean $crop
* @return void
*/
function different_fly_attached_file( $attached_file, $attachment_id, $size, $crop ) {
return '/path/to/different/file.jpg';
}
add_filter( 'fly_attached_file', 'different_fly_attached_file', 10, 4 );
Better mult-site support
Fixed bugs caused by switch_to_blog
and restore_current_blog
in a multi-site setup.
This fixes #19
Performance improvements
Improved performance by using getimagesize
instead of wp_get_image_editor
in fly_get_attachment_image_src()
Based on this issue: #15
New helper functions to get previously defined image sizes
New helper functions to get previously defined image sizes:
fly_get_image_size( 'my_size' )
returns the size details in an array.
fly_get_all_image_sizes()
returns all the defined sizes in an array.
This fixes: #14
Better handling of file names with decimals
Handles file names with decimals better. This fixes #10
Removed image optimization :(
After much deliberation, the image optimization feature has been removed from this plugin for the following reasons:
- It could lead to security vulnerabilities.
- It is not the best solution.
- It is no longer in the scope of this plugin. Future releases will focus on improving image cropping and other image manipulation. Third-party image optimization plugins can hook on to this plugin.
Version 2!
This release features a complete re-factor of the plugin using better coding practices, standards and unit tests.
New features
1. Image optimization
Image optimization has finally arrived - sort of. You'll still need to install the utilities on your server before it can start working.
2. WP CLI
You can now use WP CLI to manipulate your Fly Images! With this release you can:
- Delete all fly images
- Delete specific fly images
- Optimize new images
- Optimize all images
More information here: https://github.com/junaidbhura/fly-dynamic-image-resizer/wiki/WP-CLI
Updates to the documentation
All documentation for this plugin has been moved to the Wiki page of this repository: https://github.com/junaidbhura/fly-dynamic-image-resizer/wiki
Added crop positions and new hook
Crop Positions
Added support for crop positions. Images can now be cropped from the top, left, right, bottom or the default: center
Changing:
fly_add_image_size( 'home_page_square', 500, 500, true );
To:
fly_add_image_size( 'home_page_square', 500, 500, array( 'right', 'top' ) );
Crops the image from the top right instead of from the center, which is still the default behavior.
New hook: 'fly_image_created'
You can hook on to when a new fly image is created. Maybe to optimize the image? Maybe just to keep track?
/**
* Fly Image Created Hook
*
* @param integer $attachment_id
* @param string $path
* @return void
*/
function new_fly_image_created( $attachment_id, $path ) {
echo 'New image path: ' . $path;
}
add_action( 'fly_image_created', 'new_fly_image_created', 10, 2 );