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
The results are in! See what nearly 90,000 developers picked as their most loved, dreaded, and desired coding languages and more in the 2019 Developer Survey.

Questions tagged [image-resize]

When the user uploads an image, WP automatically resizes it to all the sizes that have been registered. Existing images are not resized when the theme is switched. There are filters available to influence the resizing process.

1
vote
1answer
765 views

Resize header image

How can I access to the css file where is the header's background image? background: url("http://xxx.es") no-repeat scroll center top / 1600px auto transparent; It's not in the style.css
0
votes
1answer
10 views

Set custom banner image size with wp_customize

I've set the banner image of my site to be customizable through appearance -> customize. I'd like to adjust the image size and crop aspect ratio of the customizer, as it's still set to a thumbnail ...
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 ...
0
votes
0answers
9 views

Is it possible to remove original src from wp_calculate_image_srcset() results?

Was just wondering how one could load a custom srcset stack. I know the srcset loads all registered sizes so I'm good on that side but I cannot find a way to remove the original src from there without ...
1
vote
1answer
460 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 ...
1
vote
0answers
38 views

Hardcoded Images Too Big

I have a ton of hardcoded images and a bunch of custom image sizes. All image URLs within the content of the posts link to the full-size image. I tried a string replace on the_content filter adding ...
3
votes
1answer
481 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. ...
0
votes
2answers
529 views

Automatically generate missing images

I'd like to auto-generate images, or rather image sizes, in old posts where the size is currently missing. Specifically I'm hoping to generate sizes on the fly when a specific (old) image size is ...
0
votes
4answers
52 views

How can I server scaled images?

I am working on an eCommerce website, with WooCommerce powering the shopping side of things. The website has a 'Recent Reviews' Widget, within the Footer. As well as the Review itself, it also ...
0
votes
3answers
1k views

Google Page Speed Insights - Optimize Images

The top recommendation from Google Page Speed Insights is to optimize & compress images. How do I do that? It lists dozens of images and that would be practically impossible to do it all manually. ...
15
votes
6answers
14k views

How to disable WordPress from creating thumbnails?

I've been looking around the net for a long time on how to disable WordPress from creating multiple thumbnails. I've seen in most tutorials to set all the images to 0 in the media section. I have ...
0
votes
1answer
16 views

Page size too big due to images

I hope it's a fitting question to be asked here. My website loads the images and then resizing them. So what happens is the image is loaded full sized and then reduced. I have lots of images already ...
1
vote
2answers
4k 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
480 views

Recalibrate _wp_attachment_metadata Image Dimensions

Migrated images from Zen Cart to Wordpress and now the correct images are there, but WP thinks that each one has dimensions of 100 x 100. If I use the WP image editor and make a trivial change in the ...
-1
votes
0answers
20 views

Image size in browser is defaulting to fill the container despite editor / styling settings

I am in the process of building my first theme. I have built everything up slowly and have a very simple setup. Now I am stuck on something that is probably a very easy fix. Problem: When I add an ...
3
votes
1answer
794 views

Crop image to horizontal or vertical by code based on image size

my client asked me to create gallery(WP gallery) based on this site. the problem here is that i need to crop images based on image size before inserting the image in the Media library. now i using ...
1
vote
1answer
2k views

How to fit image to Thumbnail canvas size?

I need to upload images with a different orientation (portrait and landscape) and I don't want to crop post-thumbnails. But I need always thumbnail size 250x250px. If I upload a portrait oriented ...
0
votes
1answer
37 views

How to accept images at multiple sizes and aspect ratios and display as standardized image size / ratio?

Lets say I accept guest post submissions. On the post archive page I have the image the user uploaded with the post on the left and an excerpt of the post on the right. Unless I programmatically ...
2
votes
1answer
1k views

Size article thumbnails and retrieve them directly from database

I've integrated the Wordpress database directly with my .NET application. What I want is to set the featured image of a post. This featured image must be maximum 800pixels wide, and automatically ...
1
vote
0answers
48 views

How generate 200% image size and save with suffix @2x

I need to know is it possible to generate 200%,200% image size and save with suffix @2x simply in WordPress? want to enable a simple retina ready theme.
-1
votes
2answers
11k views

Woocommerce resize existing product images

We discover that our Single Product images as set in Woocommerce> Setting > Products > Display are set to big. Single Product Image: 500 ×750px xHard Crop I have tested plugin regenerate thumbnails ...
0
votes
0answers
29 views

Load only imagens resized in custom page

I have a custom page called "produtos", and i have created a php file for showing the image in frontpage, but i desire to load only resized images, not raw image rezised. My code is: <?php /** * ...
0
votes
2answers
934 views

How to add css class to image attached in all the posts?

Currently by default image have similar classes <img class="size-full wp-image-8996" src="https://nepaltimes.net/wp-content/uploads/2018/04/31043884_1792179470828697_8330507756888915968_n.jpg"> ...
0
votes
2answers
83 views

GIF featured image is resized on server but not used in frontend. Why?

I use a very basic setup of twentyseventeen and die most recent wp version. When I upload PNGs or JPGs they as a featured image, they are saved as a resized version on my uploads folder and used on ...
-1
votes
0answers
21 views

Generate a thumbnail only for the first image & resize images if too big and delete originals

I built a plugin that for each new post, it uploads 5 pictures (from URL). The first one is the Thumbnail and the other 4 images are regular attachments. I'm using the code on the following topic and ...
1
vote
1answer
33 views

Stopping WordPress from Auto Generating Image Files for Sizes

I have a custom post type with an image upload meta field. Every time I upload it an image with it though, I am getting extra image files for each of the predefined sizes from the theme's functions....
1
vote
2answers
370 views

Force WordPress, themes & plugins into using defined sizes

Many users do not compress or resize their images before uploading them into a post, so source images can often be a lot larger than the settings in /wp-admin/options-media.php. Many theme and plugin ...
5
votes
3answers
53k views

PNG with transparent background turns black when uploaded and resized

Steps to reproduce: Create a PNG-8 with a transparent background. Upload to WordPress 3.3.1. View original PNG in any browser, Chrome, Firefox, IE, etc. Notice that it retains transparency as it ...
3
votes
3answers
4k views

Impose a Maximum Limit on Image height and width upload size

Clients have been uploading huuuge images, then complaining that the server is running out of memory. Ofcourse one could bump the amount of memory, but this just introduces an arms race. What hooks ...
0
votes
1answer
32 views

How to resize image in wordpress from backend? Seems like bug in wordpress

I'm trying to resize images to smaller sizes using wordpress admin. But I have trouble doing it. I have selected an image and opened it for editing. Original dimensions of my image is 255 × 300. ...
0
votes
2answers
462 views

Images uploaded on frontend display correctly but not in media editor.

if ($_FILES) { $uploaddir = wp_upload_dir(); $file = $_FILES[featured_image]; $uploadfile = $uploaddir['path'] . '/' . basename( $file['name'] ); ...
0
votes
0answers
20 views

Best way to manage theme images

I am currently wondering what is the best way to let the user choose between a certain number of thumbnail size for the shortcodes I am building. add_image_size function is the simplest way but ...
0
votes
1answer
197 views

Resize uploaded original images to a minimum automatically

Facebook recommends to use for sharing images with a minimum size of 600 x 315 pixels and an 1.91:1 aspect ratio. Is there a way to automatically resize down original images uploaded to Wordpress to a ...
0
votes
1answer
59 views

Link to resized media file

I have a WordPress website with existing content and images. Currently, images in posts link to the original media file. I’d like to modify this, such that they link to a resized version of the image (...
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: ...
1
vote
0answers
225 views

Replace original image, WP image editor

By default WordPress doesn’t overwrite an existing image, if image is edited using built-in image editor, instead of that new image is created. For example image file: image-file-name.jpg is edited, (...
0
votes
1answer
157 views

restrict uploaded image size and fixed image display size

I quite new in wordpress , and currently studying it. I am trying to build a kind of blog for a project and i am stuck in some part. I've made a search on this website and it seems that nobody has ask ...
2
votes
2answers
29 views

Image file sizes increasing on upload

I'm having a little odd problem where by when I upload an image I have optimized down to say 200kb, when its displayed on the site WordPress has actually increased the file size to 800kb. My ...
0
votes
1answer
44 views

Upload image without resizing but insert in post with resizing

OK so I tried to find this problem in whole web but didn't got any solution. . basically. I have set in my Options > Media Settings : Medium size : Max Width : 500px| Max height : 500px When I ...
0
votes
2answers
57 views

How decrease the size of images which are present in uploads folder?

I want to resize images in uploads folder. What would be the best way to resize images on a live website?
0
votes
0answers
41 views

Resize images to match CSS

I was wondering is there any way to automatically resize images to match the dimensions set by the user. What I mean is: User creates a post and he puts an image with id="my_img" and src /my_path/...
5
votes
3answers
2k views

How to avoid Wordpress stripping EXIF metadata when resizing images?

Metadata is information about an image, and can be included in JPEG image files. EXIF metadata is information about the image recorded directly from the camera – for example, the exposure time and ...
6
votes
1answer
410 views

Maintaining image color and quality when uploading using custom sizes

One continual problem with clients is that they tend to upload 5MB images directly from their devices onto their websites. Best way around that, since we can't really enforce proper image sizing and ...
0
votes
1answer
57 views

Is there a resolution limit in image resize?

I am trying to resize an image with width around 6000 to 7000 pixels, but the file size is low (less than 3.8Mb). When I pass such huge images to image_resize function its not resized. Any ideas on ...
4
votes
7answers
6k views

How to remove 20 GB of resized images?

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....
10
votes
3answers
10k views

How To Delete Desired Image Sizes From wp-content/uploads?

My default media setting in WordPress blog is 150x150, 300x300, 1024x1024 respectively for thumbnail, medium, large images. Now I am designing a theme that need different size thumbnail images to show ...
0
votes
2answers
127 views

Images not aligning correctly

I am trying to upload new images to a website which was built by a developer. I know my image sizes are wrong but what is the best way to ensure all images are the same size in the browser?
2
votes
1answer
1k views

Rename image during upload using date and time stamp?

I am trying to rename images during upload to avoid problems with image file names containig special characters and file names with non-latin characters. I found this function to rename images in ...
3
votes
2answers
1k views

Disable resizing of gif when uploaded

Animated gifs are getting more popular on the web (again) and currently there is no good tool for resizing animated gifs. So I want to disable resizing/generation of image sizes for the gif mimetype ...
17
votes
10answers
18k views

How to generate thumbnails when needed only?

I have 1000 images. How can i make wordpress to generate thumb only when needed. For example home slider will only use 10 images i dont want the other 1000 images have that thumbnail generated as its ...