Articles of add image size

Generate image for newly added size

I have added a new image size to a wordpress site with lots of images already present with all their thumbnails. Is there a way to do this: given the post using a specific image, get the attachment image and generate the thumbnail of the new size? I’m looking for a way to do this […]

Add padding while generating thumbnail

I wanted to know, if there is any function to handle following case: I have registered image size of 200×200, Now if user uploads 100×100 or 800×120 the thumbnail of 200×200 will not be generated. I want to generate 200×200 by adding padding to thumbnail.

Modifying protexted image sizes: use “add_image_size()” or “update_option()”?

I’m finding conflicting info on whether it’s okay to override protected WordPress image sizes (thumbnail, medium, medium_large, and large) with add_image_size(). Some docs indicate it’s better to do this with update_option (). Is there a practical difference between these sets of code: function mytheme_image_sizes() { add_image_size(‘thumbnail’, 200, 200, true); add_image_size(‘medium’, 480, 480, true); } vs […]

Responsive Images – crop don't seem to work

most likely I didn’t got the idea of responsive images right know, so please consider pointing out misunderstandings in that concept. What I want to have: I have a page where I query for custom post types and echo their titles and thumbnails. The custom image size is set to 300x225px and I ask wordpress […]

How to throw admin notice error on image upload

I created a plugin that creates a new image size and turns it B&W. I need the script to throw an notice if the user upload an image smaller then 1000×1000. I tried this, but WordPress is ignoring it, it just gives me a general HTTP error. GENERATE IMAGE SIZE function register_watermarked_size() { add_image_size( ‘watermarked’, […]

Is there a way to avoid using add_image_size? Best way to manage images

Currently if you have a theme that use add_image_size for let say 6 different image size you will have 6 different thumbnail created that will maybe never be used. With the current version of WordPress what is the best way to make a theme that use 6 or more image size. What about the wp_get_attachment_image […]

Change “Thumbnail”, “Medium” and “Large” image sizes using functions.php?

Right now I’m using add_image_size to create the thumbnail sizes needed for my theme, completely bypassing the options in Settings > Media since I can’t depend on users to enter the correct values manually. However, that means WordPress is creating files for each of those sizes which will never be used. Is there any more […]

Rotating image does not work for custom image sizes

When rotating an image with the WordPress image editor it creates new images and renames all of the images for the thumbnail, medium and large image sizes that are default for WordPress. My problem is that I have registered new image sizes using add_image_size(); Is there anyway to make WordPress rename/rotate these custom image sizes? […]

Image Uploader API

I want to create a widget for my theme that will let me upload an image to WP and crop it to a certain size. Can anyone point me to the codex page or a tutorial on how to a bare bone implementation of it?

Image rotation fails to regenerate custom sized thumbnail

I’m using custom image dimensions in functions.php like this: add_image_size( ‘custom-size-thumbnail’, 120, 120, true ); I uploaded some pictures with wrong orientation, so I used “edit” options to rotate them… Problem is, that only original size pictures (full, large, medium, thumbnail) are regenerated (as a new file in the FTP directory – original picture.jpg, rotated […]