-
Notifications
You must be signed in to change notification settings - Fork 9
Closed
Description
I digged a bit deeper into your code and found the root cause of my problem. You generally use fill for the crop. This in my opinion only fits for thumbnails but usually not for all other image sizes.
My suggestion would be to alter the function filter_image_downsize() and check if crop is used for the current image size.
I've tested the following solution and it seems to work fine:
Beginning from line 81 change
$args = array();
if ( 'full' !== $size ) {
$args = array(
'transform' => array(
'width' => $dimensions['width'],
'height' => $dimensions['height'],
'crop' => apply_filters( 'cloudinary_default_crop', 'fill' ),
),
);
}
to
$args = array();
if ( 'full' !== $size ) {
$crop = 'fit';
if ( (bool) get_option( $size . '_crop' ) ) {
$crop = 'fill';
}
$args = array(
'transform' => array(
'width' => $dimensions['width'],
'height' => $dimensions['height'],
'crop' => apply_filters( 'cloudinary_default_crop', $crop ),
),
);
}
What do you think about that?
Regards,
Peter
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels