8
votes
add_image_sizes ignoring crop sizes and using proportion
WordPress "crop" doesn't literally mean crop. As in take an image and cut out this precise portion of it from specified point.
What it roughly means is: resize image to fit as well as possible, then ...
5
votes
How to delete resized (cropped) image uploads and prevent future resizing?
You can easily delete files using "find" command on linux, just needed to do the same thing. You can run the following in bash console:
cd /var/www/wordpress/wp-content/uploads
find -type f -regex '.*...
5
votes
How to delete resized (cropped) image uploads and prevent future resizing?
A majority of the answers covered how to stop creating future default image sizes but this doesnt account for creating any custom sizes in your theme but here is another solution to add to functions....
5
votes
Accepted
using media uploader to select image of specific size, enforce cropper
First use the code given by @Darren on any page. For simplicity I've combined PHP and JS code in single block:
<?php $heading_picture = esc_attr(get_option( 'heading_picture' )); ?>
<...
4
votes
Accepted
Why does the Hard Crop option Scale?
They are not the same. In the 800x350 image, a little bottom is cropped.
This is how the hard cropped work:
First, it scales your image to match your image size. It can be width or height. Your size ...
4
votes
using media uploader to select image of specific size, enforce cropper
It looks like the select and crop functionality is currently only used in the WordPress Customizer.
However, after looking over the code in the Admin folder of WordPress I was able to get it working ...
4
votes
"There has been an error cropping your image" when cropping image
There is too little information to be completely sure, but usually this error occurs when WordPress cannot find the graphic library which should be installed on your server. So you should check with ...
3
votes
"There has been an error cropping your image" when cropping image
I solved this installing the next library
sudo apt-get install php5-gd -> for php5
sudo apt-get install php7.0-gd -> for php7
sudo apt-get install php7.2-gd -> for php7.2
3
votes
get_the_post_thumbnail_url with an unregistered size
WordPress does not create any thumbnail on the fly. If you try to fetch a size that doesn't exist, either the closest size or the full size image will be retrieved.
The closest solution you can try ...
3
votes
Local WordPress installation doesn't crop images
For the record since I ended up here when experiencing the same issue on my localhost:
In php.ini, Uncomment the line with: extension=php_gd2.dll
Restart apache / all services
This sorted it out ...
3
votes
Custom image size / thumbnail - Crop to aspect ratio even when source image is smaller than set dimensions
This isn't a really good solution since it's a newer CSS solution and it's only working in 78.9% of users browsers, but there are a few polyfills that can overcome that object-fit-images and fitie
...
2
votes
Custom image size / thumbnail - Crop to aspect ratio even when source image is smaller than set dimensions
You're right that it just doesn't work like that.
If it's OK to think of your question the other way around though, you can get the right outcome in modern browsers using a selection of image sizes ...
2
votes
Why WordPress automatic cropping all my images?
To disable cropping, insert this below code in disable-automatic-image-crop.php file in your mu-plugins folder:
<?php
/*
Plugin Name: Disable Automatic Image Crop
Author: Wordpress Community
...
2
votes
Accepted
Image with large file size not cropping
By default, WordPress uses the GD Graphics Library to resize and crop images. On servers with limited resources however, GD fails on images with large file sizes.
If you really need to keep the size ...
2
votes
"There has been an error cropping your image" when cropping image
I was facing same issue and unable to understand how to resolve this issue by following given ideas on every portals as I am not hardcore programmer so it was not possible for me to understand their ...
2
votes
Accepted
wp_get_attachment_image_src on multisite
wp_get_attachment_image_src() function returns an array that's why your code isn't working. Try the following code.
<a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home">
<...
2
votes
Accepted
Use get/the_post_thumbnail with Custom Size & Crop
No, there's not a way to do this by using the_post_thumbnail(), neither it's recommended.
What you are looking for is cropping the images on the fly. This will cost heavy server resources, especially ...
2
votes
How to delete resized (cropped) image uploads and prevent future resizing?
If coding is not your strongest point you may want to look at a plugin solution.
What I have in mind is a suggestion of a couple free plugins residing in the WordPress repository:
Media Cleaner by ...
2
votes
How to delete resized (cropped) image uploads and prevent future resizing?
No idea, how to remove existing images. But you can stop generating image sizes for new images you are going to upload.
If you like to write codes:
Place this code snippet in your theme's functions....
1
vote
add_image_size is scaling, even though crop is set to true
The fact that GD is loaded doesn't mean it is actually used for handling the images. From the pastebin code you give I conclude that your theme comes bundled with the Kraken image optimizer (as a ...
1
vote
add_image_size is scaling, even though crop is set to true
I think your problem could be, that you need to set the high priority (try 101, or even 999 if it solves):
add_action('after_setup_theme', 'add_custom_sizes', 101 );
1
vote
add_image_size is scaling, even though crop is set to true
from your question i under that you want fixed size cropped images when you upload image, why don't you use wp_get_image_editor. I used it in my project where i wanted cropped images of fixed size so ...
1
vote
How to delete resized (cropped) image uploads and prevent future resizing?
If you have SSH access then you can run the following commands to list and remove the resized images. Later you can rebuild them.
List all resized images.
# List all resized images.
# Usage: lrimg ...
1
vote
How to delete resized (cropped) image uploads and prevent future resizing?
To remove all superfluous image files, we'll have to loop through all posts, find the attachments to those posts, establish which attached image sizes are no longer needed and remove those files. Here ...
1
vote
is it possible to crop cover images in buddypress?
The cover picture is not intended to be cropped.
When you use this feature, the component tells you which min. image size should be used. If it comes up or not is depends largely of your theme and wp ...
1
vote
Cropping an image before inserting into a post
I think you are good, but you don't need to use other functions. You have all in
File: wp-includes/media.php
For instance, you may _wp_get_image_size_from_meta to get the image dimensions, so you ...
1
vote
How to delete resized (cropped) image uploads and prevent future resizing?
Here's a way you can do this programmatically (for the most part).
1: Set your media sizes (ex: thumbnail 300x300 and the rest 0x0 to keep WP from generating anything other than thumbnail.)
2: ...
1
vote
How to resize images in wordpress without adding any compression or changing the color profile of the images, possible?
This is a bit of a hack, but you can always add custom CSS to add back in some saturation using filter: saturate(). I find 1.6 is about right, i.e.:
img.size-large {
-webkit-filter: saturate(1.6);
...
1
vote
Is is possible to crop an image after uploading
Untested, but I believe this should work:
jQuery(document).ready(function (){
jQuery(".select-image").click(function() {
var custom_uploader = wp.media({
title: 'Selecteer een ...
1
vote
Force square image crop during upload?
Your assumption that all images are uploaded from a browser is false. Currently images can be uploaded via the XML-RPC protocol and once the REST API will be merged it will also be used to upload ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
cropping × 85images × 54
post-thumbnails × 22
uploads × 12
thumbnails × 11
media × 10
media-library × 6
functions × 4
theme-development × 4
plugins × 3
php × 3
customization × 2
child-theme × 2
attachments × 2
theme-customizer × 2
responsive × 2
media-settings × 2
scale × 2
posts × 1
multisite × 1
themes × 1
css × 1
admin × 1
advanced-custom-fields × 1
gallery × 1