Articles of add image size

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 […]

Add_image_size not cropping

I want to make a crop on the images of my blog page that have more than 443px adjust it to 645×443 size, exactly. I used this code: add_theme_support (‘post-thumbnails’); add_image_size (‘blog-page’, 645, 445, true); However, the image is resized instead of making the crop. Exemples: Original image: http://img843.imageshack.us/img843/6444/56004879.jpg How is: http://img.mywordpresstips.com/thumbnails/53926495.png How i want: […]

How to get cropped thumbnail source for custom post type

I need thumbnail image url with size 148*148px. I using custom post type for testimonials. I need just the image source like http://example.com/demoimage.jpg. It is possible to get cropped image source. ‘add_image_size’ doesn’t solve my problem. I have some classes and some data attribute in my <img> tag. Please help Thank You

Large image size stuck on old value, even for new images

I changed the ‘Large’ image size in Settings > Media > Image Sizes from the default to max-width 586px. That was wrong, so I changed it back to max-width 1024px. However, the smaller size seems to have stuck. When I upload new images now, the size option for Large is 586px wide, even if the […]

Regenerate thumbnails after upload

I have this nice little code coming straight from the WordPress codex if($_FILES[‘user_picture’][‘size’] != 0): if ( ! function_exists( ‘wp_handle_upload’ ) ) require_once( ABSPATH . ‘wp-admin/includes/file.php’ ); $uploadedfile = $_FILES[‘user_picture’]; $upload_overrides = array( ‘test_form’ => false ); $movefile = wp_handle_upload( $uploadedfile, $upload_overrides ); if ( $movefile ) { $wp_filetype = $movefile[‘type’]; $filename = $movefile[‘file’]; $wp_upload_dir […]

Custom image size in Media Dropdown

I’ve tried everything you have said, but it’s not working on my site. I’m using the below function: function setup_image_sizes() { if ( function_exists( ‘add_image_size’ ) ) { add_image_size( ‘blog_body_img’, 740, 0, true ); } } add_action( ‘after_setup_theme’, ‘setup_image_sizes’ );*/ function post_image_sizes($sizes){ $custom_sizes = array( ‘blog_body_img’ => ‘Blog Body Image’ ); return array_merge( $sizes, $custom_sizes […]

Overwriting Parent Theme's Image Sizes

I’m using Raw by UDTHEMES as a parent theme for a site I am working on. In the parent theme, there is the following image size: add_image_size( ‘udt-full-width-image’, 870, 490, true ); And I am trying to overwrite it in my child theme like so (I have been told that I first need to unset […]

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 terrible job at keeping the file size small. For instance: I have a 2400 x 1850 px image – at 384 kb […]

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 my host, and that is how GD library works by default, strip out all image info. After research I found out […]