-
-
Hello,
we have a trouble with images. All images that are not in the default size are weirdly cropped. Especially those images in the portfolio. I get why they have to be cropped but can we perhaps change the way thay are cropped and not center the result but crop everything except the left corner? I hope I described the situation correctly. I’m adding an image so you can see what I mean better.
We don’t want it to be the case 1, we want the case 2.
Best regards
Mepatek
-
Hello,
The code responsible to register a new image size image is in function
codeless_images_sizes()
:
add_image_size ( string $name, int $width, int $height, bool|array $crop = false )
Cropping behavior for the image size is dependent on the value of $crop:
If
false (default)
, images will be scaled, not cropped.
If an array in the form of `array( x_crop_position, y_crop_position ):
x_crop_position accepts ‘left’ ‘center’, or ‘right’`.
y_crop_position accepts ‘top’, ‘center’, or ‘bottom’. Images will be cropped to the specified dimensions within the defined crop area.
If true, images will be cropped to the specified dimensions using center positions.Example, if you want to scale the images of blog then find this line:
add_image_size( 'blog', 825, 340, true );
and replace with this:
add_image_size( 'blog', 825, 340, array( 'left', 'top') );
Source file: specular/functions.php (line 145)
Best regards!
-
Hello,
thank you for your response.
Do I have to clear the cache or something for this to work? I have changed the code in functions.php to:
add_image_size( ‘port3’, 600, 600, array( ‘left’, ‘top’) );
add_image_size( ‘port3_grayscale’, 627, 470, array( ‘left’, ‘top’) );
add_image_size( ‘port2’, 460, 275, array( ‘left’, ‘top’) );
add_image_size( ‘port2_grayscale’, 940, 470, array( ‘left’, ‘top’) );
add_image_size( ‘port4’, 600, 600, array( ‘left’, ‘top’) );Portfolio images are still the same, though.
Best regards
Mepatek
-
Hello,
Please import again the images. And run a plugin to recreate the thumbnails.
Best regards!
-
Hi,
the plugin that recreates the thumbnails works. Thanks!
Mepatek
-
You must be logged in to reply to this topic.