Skip to main content

Questions tagged [cropping]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
769 views

How to get Wordpress to resize images for srcset?

I've added a custom image size to my functions.php: add_image_size('banner', 1920, 300, true); I'm loading images in this custom size, using wp_get_attachment_image() to get a srcset. However ...
PWD's user avatar
  • 3
0 votes
0 answers
43 views

Plugin to select the custom image crop area

I've defined the custom thumbnail sizes and set it up in a mu-plugins script. <?php function penge_features() { add_theme_support('post-thumbnails'); add_image_size('Homepage Carousel', ...
Wasteland's user avatar
  • 101
1 vote
1 answer
816 views

How do I get a smaller size of an avatar image

I have a function that creates a bio-line at the top of every post. One part gets the avatar of that user, that he uploaded in WordPress (I use a plugin so people don't need to use Gravatar for this). ...
TheKidsWantDjent's user avatar
0 votes
0 answers
28 views

Apply manual image cropping not to thumbnail but medium_large size

When cropping an image in wordpress you can apply the changes to all image sizes at once, the thumbnail (150 x 150) or all sizes except thumbnail. I would like to be able to select other image sizes ...
RaWa's user avatar
  • 3
0 votes
1 answer
27 views

Removing extra large generated images disables all crops

function filter_image_sizes( $sizes) { unset( $sizes['1536x1536']); // disable 2x medium-large size unset( $sizes['2048x2048']); // disable 2x large size return $sizes; } add_filter('...
RMH's user avatar
  • 183
1 vote
1 answer
1k views

There has been an error cropping your image

I've searched quite a bit and every single article seems to suggest the same thing, which I've tried to no avail. I've already tried installing php7.4-gd. it did not fix the issue. I tried adding this ...
Santiago Welbes's user avatar
0 votes
0 answers
826 views

How to crop image in WordPress with aspect ratio for any size of image

I am using following function for cropping image in wordpress and I want to crop image in 1:1 aspect ratio. When I upload large image compared to specified size in function it works well but when I ...
Kalpesh's user avatar
0 votes
1 answer
102 views

Can't locate custom image sizes defined by child theme

I'm developing a child theme (mms-child) based on a simple parent (mms – also my dev). I am quite used to the usual way of defining custom image sizes within functions.php as follows: ...
mtm's user avatar
  • 43
0 votes
1 answer
479 views

Disable Responsive Image Sizes crop

I think my question might similar to others.Here is my problem, I want to remove generating wordpress responsive images because I have done image responsive solution with my way. So, I don't wanna ...
Por's user avatar
  • 382
1 vote
2 answers
960 views

Hero image cropped at different dimensions

I have a site with a hero banner image. This is how it looks on desktop: This is how it looks on mobile (via Chrome Dev tools): As you can see, the image on mobile is too narrow, I want it to look "...
Santiago Valdés's user avatar
3 votes
3 answers
1k views

add_image_size is scaling, even though crop is set to true

I am trying to crop a 1000 x 648 image to 400 x 400. I use this code in functions.php add_theme_support( 'post-thumbnails' ); add_image_size('shop-size', 400, 400, array(center,center) ); ...
Tintinabulator Zea's user avatar
4 votes
4 answers
25k views

"There has been an error cropping your image" when cropping image

I am setting the header image in WordPress and when I click on the crop button, it shows me the following error: There has been an error cropping your image.
Dead Pool's user avatar
0 votes
1 answer
689 views

wp_get_attachment_image_src on multisite

I try to get cropped image src on my subdomain multisite, but not working. My code here: // avatar uploader $wp_customize->add_setting( 'bwpy_logo2', array( 'sanitize_callback' => 'absint', ...
Galgóczi Levente's user avatar
2 votes
1 answer
2k views

Use get/the_post_thumbnail with Custom Size & Crop

We know that the_post_thumbnail() outputs the thumbnail & that the_post_thumbnail( array(100,100) ) outputs the thumbnail at a specified size. And we know that we can use add_image_size( '...
admcfajn's user avatar
  • 1,326
1 vote
1 answer
2k views

Stop WordPress from cropping images using url parameters

I've specified some custom image sizes each with a non-default crop position (e.g. top-center). However, when I use wp_get_attachment_image and specify size to be one that I defined, I get a correctly ...
Joel Christophel's user avatar
6 votes
4 answers
5k views

using media uploader to select image of specific size, enforce cropper

I've followed this article to use Media Uploader in my code. When I click the Browse button on my form, the media uploader opens and after selecting the image, I get the URL of that image added in my ...
Vivek Athalye's user avatar
5 votes
1 answer
14k views

get_the_post_thumbnail_url with an unregistered size

The official code reference for get_the_post_thumbnail_url states: $size (string|array) (Optional) Registered image size to retrieve the source for or a flat array of height and width dimensions. ...
That Brazilian Guy's user avatar
1 vote
1 answer
2k views

Local WordPress installation doesn't crop images

When I try to crop an image in the WordPress backend area of my custom theme, I get the message "There has been an error cropping your image". I have it set up on a local machine using XAMPP. When I ...
TheKidsWantDjent's user avatar
0 votes
0 answers
212 views

Crop an image after upload on custom account page

I have a custom account page in WordPress where I would like users to be able to upload an image that replaces the default WordPress avatar. I have the upload process working great, but I need to crop ...
Andrew's user avatar
  • 249
0 votes
1 answer
61 views

Image with large file size not cropping

I just set hard crop in function 676x429 hard crop. add_image_size('home-slide', 676, 429, true); Its working but client uploaded a large file something like 3800x3800 (5.73mb) and it doesn't crop. ...
Jows's user avatar
  • 187
1 vote
1 answer
733 views

is it possible to crop cover images in buddypress?

Hi i'm using buddypress v2.7.4, i can do crop avatar image but not the cover image. Is it possible to crop that cover images ? i saw these directories have different files wp-content/plugins/...
Hend Ry's user avatar
  • 29
1 vote
1 answer
1k views

Cropping an image before inserting into a post

I've got a frontend post form, and I've been using this PHP code to allow uploading an image and to insert it into a post. // image upload and attatching to post if ( ! empty( $_FILES ) &&...
Andy's user avatar
  • 55
1 vote
0 answers
2k views

Show image crop window on image upload

I'm trying to add image from front end and crop it after upload. Used setState( 'cropper' ); to enable image crop window. It open the image upload window. Upload an image. But, Not open Image Crop ...
maheshwaghmare's user avatar
10 votes
12 answers
27k views

How to delete resized (cropped) image uploads and prevent future resizing?

I want to delete all the resized images while leaving the original image. I have more than 20 GB of unused data taking up room on the server. For example: first-image-name.jpg first-image-name-72x72....
Mohamed Gamal's user avatar
1 vote
0 answers
1k views

Forcing a user to crop the featured image in a certain aspect ratio

I am developing a child theme where I want my featured image to be 3:1, so I won't have my whole page filled with the remainder of the image. Is there a way to force the user to crop in this aspect ...
Kay van Bree's user avatar
12 votes
2 answers
10k views

Custom image size / thumbnail - Crop to aspect ratio even when source image is smaller than set dimensions

Normally when you set a custom image size using hard crop - e.g. add_image_size( 'custom-size', 400, 400, true ); - you get the following results: #1 Uploaded image: 600x500 > Thumbnail: 400x400. #2 ...
Joey Joe Joe Junior Shabadoo's user avatar
3 votes
1 answer
534 views

add_image_sizes ignoring crop sizes and using proportion

Before we start, the image is definitely big enough. I have an image that is 2206 x 2042 and I wish to crop (not scale) it in a number of different ways to be used responsively. The sizes I am ...
wagg-matt's user avatar
3 votes
0 answers
40 views

Wordpress crops some thumbnails but not others? [duplicate]

For some reason Wordpress is cropping some of my thumbnails proportionately rather than to specific dimensions for some images, and cropping them to specific dimensions for others. I want it to crop ...
5AMWE5T's user avatar
  • 149
1 vote
1 answer
610 views

Why does the Hard Crop option Scale?

I have a number of custom image sizes. I noticed earlier, when I was publishing a new post, that the post image was cropped AND scaled. It is exactly the right dimensions.. but it isn't the portion of ...
Josh C's user avatar
  • 273
1 vote
0 answers
420 views

Edit image results in copies of file being created

I am encountering what appears to be a file duplication issue when using the "Edit image" function. In this case specifically I am cropping the image but any edit process should have the same effect. ...
Rick Curran's user avatar
  • 1,076
4 votes
1 answer
2k views

Is is possible to crop an image after uploading

I'm trying to build a plugin, and part of it requires to upload (or choose an already uploaded one) an image, and when it's done uploading to crop it (a bit like how you change a header image in the ...
Jeroen's user avatar
  • 229
0 votes
1 answer
43 views

Wordpress not using edited image

I have uploaded a picture to media library and cropped the image in wordpress editor but when selecting the edited image http://mariehelenesund.se/wp-content/uploads/2015/11/Kicki-e1447542665309.jpg (...
HannesH's user avatar
  • 75
0 votes
1 answer
2k views

Force square image crop during upload?

I'm developing my own theme where I have fixed the left sidebar with my photo. Is it possible to force users to crop their image to a square during upload? If yes, how? What functions I will need?
Filip Madunicky's user avatar
0 votes
1 answer
52 views

Thumbnail generating and posting

I have PHP code that generates a thumbnail, but it crops out the wrong part of the image and displays wrong. How does it know what part to crop out, and how do I fix that to crop out the portion of ...
sizemattic's user avatar
1 vote
0 answers
91 views

Crop image with full width

Sometimes I need to crop images' heights in wordpress media library. When I try to crop the height it always decreases the width of cropped image by 2px. See the screenshot below. The original image ...
wp student's user avatar
1 vote
1 answer
306 views

Wordpress crops images differently on retina screens?

I am currently testing my websites on different types of screens and while my image cropping works perfectly on a non-retina screen, I am running into some cropping issues on retina screens. I have ...
user304165's user avatar
0 votes
1 answer
117 views

Change default "Apply Changes To" radio option when editing images

I have a theme where when the user edits images, I want the changes to apply to "all sizes except for thumbnails". She remembers to check this box most of the time, but not always, and it is very ...
dgo's user avatar
  • 125
5 votes
1 answer
596 views

Cropping, Re-sizing and Saving images from one folder to another folder in wordpress

I'm adding an upgrade for the WordPress plugin which I have developed ages ago. This plugin is just a product catalog, so just show products and their images. Products can have more than one images. ...
Omer's user avatar
  • 275
2 votes
1 answer
1k views

How to crop image from center using wp_image_editor

I am working on WordPress plugin. In plugin the user upload images from meta field and in back end i use wp_image_editor for cropping and re sizing the images. The images re sized very well but on ...
deemi-D-nadeem's user avatar
0 votes
5 answers
8k views

Wordpress images not cropping properly

I have my post image thumbnails set with: add_theme_support('post-thumbnails'); set_post_thumbnail_size(1280, 436, true); add_image_size('general-thumb', 600, 339, true); They are resized ...
ninja08's user avatar
  • 147
0 votes
1 answer
551 views

variable crop option with add_image_size()

In my child Theme I have set my custom image with add_image_size( 'big', 1500, 1000 ) I left out the crop parameter, but it is [false by default][1] anyway. I want to make this a variable option. I ...
TunaFFish's user avatar
  • 111
0 votes
1 answer
3k views

Disable image rename on upload

When I upload an image (test.jpg) with the Media manager it creates the same image with a digit after its name (test1.jpg). I disabled image cropping so files like test-[width]x[height].jpg don't ...
mortalis's user avatar
  • 103
0 votes
1 answer
2k views

Set image dimension for WP_Customize_Image_Control images

In the customize page for the current theme the Current Header's Choose Image dialog shows - a "select and crop" option But the custom WP_Customize_Image_Control shows only "Choose Image". Is there ...
Akash Kumar Sharma's user avatar
0 votes
1 answer
521 views

Make custom thumbnail size crop to EXACT dimensions

I've defined a custom image size like this: add_image_size( 'home-promo', 456, 600, TRUE ); As you can see I've set the hard-crop parameter to TRUE, however it's still not cropping to this exact ...
Gavin's user avatar
  • 404
0 votes
1 answer
161 views

Thumbnails resized and not cropped in the center

here's image of some thumbnails in my wordpress homepage: http://i.imgur.com/x8EmtMO.png The first one is resized very nicely - I don't know why and how - and the other ones are cropped in the center ...
BlackJuice's user avatar
0 votes
4 answers
2k views

Post thumbnail height problem

I am trying to create a square thumbnail with auto crop with size of 300px 300px. I only get the width of 300px but the height is auto, i think is not cropping. I tried this: add_image_size( '...
Alex's user avatar
  • 111
5 votes
1 answer
1k views

Prevent WordPress from cropping GIF files

Is there any way to prevent WordPress from cropping files based on their file extension. Actually, I want to disable cropping for GIF files because after cropping GIF image... GiF image does not ...
Robert hue's user avatar
  • 8,536
0 votes
1 answer
299 views

Auto-crop width, not height

I need images to be auto-cropped if they are too wide only. Basically like this: I'm using it for a fullscreen slider, where too wide images gets stretched. Cropping obviously is the best of two ...
Garland Briggs's user avatar
1 vote
1 answer
13k views

How to upload multiple images on frontend to ACF gallery using update_field

I'm trying to save images submitted on a frontend form in a way that they are accessible via the ACF backend. In how to upload an image on ACF with update_field on wordpress, someone provided a ...
yumba's user avatar
  • 473
1 vote
1 answer
258 views

Confusion about arguments sent to add_image_size

Looking at the documentation for Cropping Thumbnails when adding new image-sizes makes me confused. Set the image size by cropping the image and defining a crop position: add_image_size( '...
bestprogrammerintheworld's user avatar