Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [cropping]

The tag has no usage guidance.

1
vote
1answer
20 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 "...
0
votes
0answers
23 views

Automatica crop image in wordpress 5.1?

original image size 777x518 when uploading this image it shows only 575x416 in WordPress 5.1. It automatically crops this image.I want, When uploading an image it will display your original size. How ...
3
votes
3answers
292 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) ); ...
0
votes
0answers
24 views

BuddyPress - User avatars problem - PHP Warning: Could not create transliterator

I have problem with uploading and cropping user avatars. In php error logs there's a lot of this warning: PHP Warning: transliterator_transliterate(): Could not create transliterator with ID &...
1
vote
2answers
5k 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.
0
votes
1answer
136 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', ...
2
votes
1answer
353 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( '...
1
vote
1answer
483 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 ...
2
votes
2answers
942 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 ...
3
votes
1answer
5k 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. ...
0
votes
1answer
277 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 ...
0
votes
0answers
95 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 ...
0
votes
1answer
35 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. ...
1
vote
1answer
397 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/...
1
vote
1answer
543 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 ) &&...
1
vote
0answers
639 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 ...
1
vote
0answers
441 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 ...
8
votes
2answers
5k 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 ...
3
votes
1answer
340 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 ...
3
votes
0answers
37 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 ...
0
votes
1answer
313 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 ...
1
vote
0answers
57 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. ...
5
votes
1answer
1k 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 ...
0
votes
1answer
30 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 (...
0
votes
1answer
924 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?
0
votes
1answer
49 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 ...
1
vote
0answers
74 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 ...
1
vote
1answer
211 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 ...
0
votes
1answer
77 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 ...
3
votes
1answer
484 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. ...
2
votes
1answer
660 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 ...
0
votes
5answers
4k 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 ...
0
votes
1answer
466 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 ...
0
votes
1answer
1k 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 ...
0
votes
1answer
1k 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 ...
0
votes
1answer
505 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 ...
0
votes
1answer
137 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 ...
0
votes
4answers
1k 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( '...
5
votes
1answer
775 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 ...
0
votes
1answer
229 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 ...
1
vote
1answer
9k 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 ...
1
vote
1answer
221 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( '...
2
votes
3answers
13k views

the_post_thumbnail scaling not hard cropping

Lately I wanted to upgrade my blog with featured images/post thumbnails. I'm using a custom theme build on the roots theme (this is not a roots theme issue, I believe). The image I upload is 1024x768 ...
0
votes
1answer
153 views

Wordpress crop image not working [closed]

I have the following CSS: .crop { height: 40px; overflow: hidden; margin-bottom: 20px; } to crop an image when the screen shrinks. It works in a normal HTML file, but in Wordpress, the ...
1
vote
1answer
75 views

How to have the thumbnail cropping tool working

I've been using wordpress (and developing on it) for years now, but never be really able to use the drop tool. So I try to ask here... If I crop a thumb, I see the right cropping in the media ...
2
votes
1answer
1k views

Generated media have incorrect aspect ratio

Uploaded an image via standard 'add new' dialog to the WordPress Media library. Here were the original Media Settings: Thumbnail - 150x150 Medium - 300x300 Large - 1024x1024 I uploaded a ...
1
vote
1answer
224 views

How to both crop (with tool) and resize thumbnails having only a max width constrain?

I want to use thumbnails (max. 400px width). That means thumbnails can be 400px, but not always they should be 400px width. They can be even less. So, in the same page, one thumb 400px, one 320px and ...
0
votes
2answers
3k views

wordpress add image size crop function not working in version 3.8

I am using twenty fourteen theme to make another theme most of the files are same including the functions.php file, but the problem I am having is , When I add image size ( with true crop, hard crop ...
3
votes
1answer
5k views

Image resize with image url

I am using wp_handle_upload() to allow users to upload the images in back-end and I want to re-size images to a custom size before uploading it. Is there any way without using any plugins or so to ...
6
votes
4answers
29k views

Why WordPress automatic cropping all my images?

Am new to WordPress, when I upload any image, WordPress automatic crops into its own sizes which I have not mention in the media section (Settings » Media). Settings which I saved in media is: ...