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.

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 ...
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
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 ...
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
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
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 ...
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 ...
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.
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 /** * ...
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
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....
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. ...
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 ...
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
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
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
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 (...
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
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/...
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....
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 ...
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 ...
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 ...
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 ...
1
vote
2answers
3k views

Keep image EXIF info after compressing original image?

After testing I realized that Word Press after image upload will make medium and thumbnail sized images of original image without EXIF/IPTC info I realized it is because GD image library is used on ...
1
vote
0answers
50 views

Intersept image upload and generate retina image from source

My goal is to make a retina and non-retina image when user uploads a photo. This is doable like so: add_action('init', function() { // Get the original image sizes and duplicate $thumb_w = ...
-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 ...
1
vote
2answers
227 views

Responsive Images Warping

I'm using HB Themes Aegaeus theme and it's great except for the fact that one of the shortcode elements (hb-box) is resizing the images. (Obviously, automatically resizing site elements to fit a ...
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
2answers
632 views

Resize existing library images

How can I resize images that were already in the Media Library when I created new custom image sizes? I just want WP to process them as if they're new images, taking into account my new settings, ...
1
vote
0answers
40 views

Altered media sizes (in dash), not updating to existing images/posts

(I have searched but not found a satisfying answer – bear with me). I have a client that has a website with 1500 posts. Each post consists of ONE image, no text. I have changed to the Oria theme (...
0
votes
1answer
235 views

Keep the original ratio in a thumbnail image

I’m using a thumbnail size of 100 * 60 in my blog, but sometimes I want to use square images. Is it possible to use a Wordpress plugin or CSS to make it fits by adding background in the sides to keep ...
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 ...
1
vote
1answer
110 views

Is there a way to change wordpress image resize settings?

Websites nowadays tend to have big banners and big images. Thus when developing sites we try to optimize these images as much as possible. However, when wordpress resizes these images, it does a ...
0
votes
2answers
1k views

Resize image to specific dimension (X to Y ratio)

I've tried to add my custom image size like: add_image_size('224_226', 224, 226, false); I need resize all images to same size what i define in style, when i've uploaded file - Wordpress resize it ...
17
votes
3answers
367 views

Handle issues with change of image scaling (rounding) in 4.1 (WP Ticket #18532)

I am currently in the course of migrating site content from an old pre 4.1 site to a new setup and hitting an issue with the rounding error issue of #18532 and the corresponding fix. To summarize ...
0
votes
1answer
113 views

How to change this internal image link parameter using PHP?

How resize this string / change link parameter. Original file = mydomain.com/wp-content/uploads/2015/01/name-file.jpg Return to $string now = mydomain.com/wp-content/uploads/2015/01/name-file-...
1
vote
1answer
2k views

Wordpress resizes image to the same size as uploaded

I am writing a theme which uses different image sizes. Here are my targeted sizes as they are set up in under Settings > Media in WP Admin: Here is the functions.php code for the thumbnail support: ...
1
vote
1answer
2k views

resize from small images to large

I want to create large images though my original image is smaller. I have original images 1024x768 in my media library, and i want to resize these images to 1920x1080px in my WordPress posts. I ...