Kinda new to wordpress.. Creating my own theme. When I upload an image and put it in a post it comes out at 300x183 pixels but the original file I upload is 1800x1100 pixels. Wordpress alters my size when i upload it.This is what i get in the url on the post NDAppleProductMockUp-300x183.jpg.. It restricts the size of the image. When i go into the image properties within the post and click original nothing happens it stays at 300x183.. I have tried to work it out but can't Any suggestions guys..
Thanks
Unfortunately, WordPress does not resize the actual image that you upload. It creates 3 smaller versions of it, leaving the uploaded image untouched. I would suggest that you create all of your images at 1800x1100 before you upload them.
Another solution would be to link to the "big-sized" image when you "Insert into Post"... unfortunately, you would have to know the filename of the large image. I check the source code and this part of the media system does not appear to be pluggable.
Another option may be to check out this plugin:
http://wordpress.org/extend/plugins/nextgen-gallery/
This link here details how You can change what image size will be displayed
http://codex.wordpress.org/Function_Reference/add_image_size
also when u attach to post you can set the image size in the setting
THE SETTING is Before you attach the image!
you are trying to change an image that has already been attached (the attached image was in a mid or small size to begin with) so it is already at its original size.
Related
this isn't a developer question. I am just a user and I am looking at historical archives online. I would like to download some documents and the site allows that. However, I can't open the image in another tab. I can save the image but when it's saved you can only see the part that was visualized inside the container, and not the whole image. I then have to zoom it in order to make it fit in the container before saving it, but it's small.
My question is: how can I find the original source of the image in order to download it and see it in its original size?
Here is the page I am talking about:
https://antenati.cultura.gov.it/ark:/12657/an_ua16656837/Lo4OQNV/
I have changed the theme (to OceanWP). Now the catalog images in the store are no longer displayed as desired. Before the woocommerce_thumbnail was loaded (247x296). Now only the original images are inserted. Now there are differences in the display of these catalog images, which looks unsightly.
I have tried to adjust this via customizer. Here I use the thumbnail width 247 and crop to the aspect ratio 5:6. The catalog images do not respond to these settings in any way.
Then I used the Regenerate Thumbnail plugin to regenerate all the thumbnails. Again no success, everything the same as before.
I saw that for the product images that were still uploaded with the previous theme, the HTML code directly pointed to the desired woocommerce_thumbnail. For the new products uploaded via OceanWP, this is handled with "srcset", which doesn't seem to work properly. (examine the different image-object, higher and smaller once)
My wish is that the products catalog reverts to the appropriate woocommerce_thumbnail. Or, that I can override the previous settings with a code snippet so that the thumbnails are all cropped to the same size again.
I am grateful to anyone for even an approach to fixing the problem.
Regards
Tim
My site have 2 pages and the 2 pages contain a similar picture. If a user comes to the first page, he downloads the picture and then come to the second page, if I make the website so that the picture is shared between the 2 pages then the user no need to download the picture again?
If I want to put the same picture but different in size on the webpage, is it better to make 2 pictures by using image software editor or using CSS to change the width and the height of the picture?
you have answered your question.
if the image is from the same source, and if you have configured the caching on webserver correctly (and if the client has enabled cache), then there are no re-requests sent to view the same resource.
you dont need to create multiple images for different sizes, use html image attributes to show it in the grid dimensions you wish to.
Exception: if the original image is quite large, and you are not sure if the user will want to view the image, then create smaller image for faster loading. Thumbnails on a photo album is a good example for that. There is a program called re-sizer which accepts a folder and create a new set of images with the required dimensions
Resources below
Image Resizer
HTTP Compression
Where do the images resize in wordpress? In a database? In a folder?
How would I go about resizing the original image (not create a new version). I ask this, because I uploaded quite a few images that are too large and slow down load times on a wordpress site, and I want to resize them so there aren't any dimensions larger than 1500px.
I've already looked at a few plugins, including "regenerate thumbnails", but there may be one that actually does what I want that I haven't been able to find yet.
Well, the images resize "on the fly", then stored in the server and its information recorded in the database.
The original remains and all "thumbnails" are generated. In this case, "thumbnails" refers to all WP generated image sizes, big or small.
I answered the same question at WordPress StackExchange. And the solution comes from this article: How to automatically use resized images instead of originals.
This script will replace the uploaded image (if bigger than the larger size defined in your settings) by the large image generated by WordPress to save space in your server, and save bandwidth if you link a thumbnail to the original image, like when a lightbox plugin is used.
add_filter('wp_generate_attachment_metadata','replace_uploaded_image');
function replace_uploaded_image($image_data)
{
// if there is no large image : return
if ( !isset($image_data['sizes']['large']) )
return $image_data;
// paths to the uploaded image and the large image
$upload_dir = wp_upload_dir();
$uploaded_image_location = $upload_dir['basedir'] . '/' . $image_data['file'];
$large_image_location = $upload_dir['path'] . '/' . $image_data['sizes']['large']['file'];
// delete the uploaded image
unlink($uploaded_image_location);
// rename the large image
rename($large_image_location, $uploaded_image_location);
// update image metadata and return them
$image_data['width'] = $image_data['sizes']['large']['width'];
$image_data['height'] = $image_data['sizes']['large']['height'];
unset($image_data['sizes']['large']);
return $image_data;
}
You can use WordPress' add_theme_support and add_image_size to add multiple sizes for an image, which means that WordPress will create a copy of the post thumbnail with the specified dimensions when you upload a new thumbnail. To learn more about these technics you can read this tutorial.
There is also another function in WordPress and it's image_resize that can be used to scale down an image to fit a particular size and save a new copy of the image.
Most developers uses add_image_size to add multiple image size to show in different palces, i.e. you can use one image as a featured image in your home page and also can use another size of same image in the single.php page. To do this you have to use
add_theme_support( 'post-thumbnails' );
add_image_size( 'homepage-thumb', 220, 180 ); // 220 pix width,180 pix height
add_image_size( 'singlepost-thumb', 590, 9999 ); // Unlimited Height Mode
To show the homepage-thumb image in your home page you can use
if ( has_post_thumbnail() ) { the_post_thumbnail( 'homepage-thumb' ); }
Or in the single.php template you can use
if ( has_post_thumbnail() ) { the_post_thumbnail( 'singlepost-thumb' ); }
Also you can take a look at this plugin and this article could be useful too. Hope it helps.
To my knowledge there is no plugin that will directly resize your original images and change their meta data, but I've found a workaround (I had a similar problem to yours) which does not require coding.
Download your images by FTP (images are stored within the wp-content/uploads/ directory)
Make your resize/editing operations with the software of your choice and re-upload your images using FTP exactly to the same place they were before (you should not change anything in the folder structure or filenames)
Install WPR Rebuild Meta Data plugin in your Wordpress Admin. Go to "Tools -> Rebuild Meta". This will rebuild all the modified image meta data (for example it will update the new image sizes into the database)
Install Force Regenerate Thumbnails plugin in your Wordpress Admin. You can use it from "Tools -> Force Regenerate Thumbnails" to do it for all your images, or from the Wordpress Media Manager to do it just for the images you've changed. This will delete the old thumbnails and custom image sizes, and create fresh ones from your new images.
I have uploaded a photo in WordPress. I am trying to post a thumbnail of the image using a predetermined width while constraining the height proportionally.
In functions.js:
add_image_size('width-130', 130, 0, false);
On the page that outputs the thumbnail:
the_post_thumbnail('width-130');
According to the WordPress docs(http://codex.wordpress.org/Function_Reference/add_image_size), it says:
WordPress will create a copy of the post thumbnail with the specified
dimensions when you upload a new thumbnail.
Currently it is outputting the full thumbnail image with a width attribute of 130. This still requires the full size image to load, which is not what I want. I would like for WordPress to create an actual copy of the post thumbnail with the correct dimensions, and not just to set the width attribute. How can I achieve this?
I discovered my mistake.
Since I had not re-uploaded the image file, it was still trying to access the full size image which was the assigned image for that post, while adding the width attribute. Once I re-uploaded the image, the add_image_size() function is now actually creating a copy of the thumbnail with the correct dimensions.
I apologize for asking this question. If the community wants, I can close it but I figure it might be good reference for WordPress newbies such as myself.
Use this plugin to regenerate thumbnails.
http://wordpress.org/plugins/regenerate-thumbnails/
In case anyone runs across a similar problem, this may help. add_image_size generates derivatives that are smaller, but not bigger or the same size. Thus if you are trying to make a monochrome derivative image, uploading an image the same size as the monochrome, it will not be available and techniques like this one won't work.