Articles of image resize

How to get custom image sizes into media uploader dropdown?

I searched net to solve the problem with images size uploaded from media. But not even one worked to me. When I try to insert images from the media into post it does not show my custom image size 608 X 350 px function setup_image_sizes() { if ( function_exists( ‘add_image_size’ ) ) { add_image_size( ‘post-image’, […]

Resizing Images to lower Disk Space Using Plugins

I’m trying to take existing images and shrink the file size down by resizing to photos to a smaller resolution. I’ve tried a few methods so far: Simply editing the photo in photoshop and reuploaded, replacing the existing (and larger) file. I tried the Imsanity plugin and set the options to be less than 1024×1024 […]

Advanced Custom Fields

I am using the Advanced custom fields plugin to add a upload image option to a page, but I am wondering if there is a way so that, when I output it to a theme with <img src=”<?php the_field(‘add_image’); ?>”/> it is not full size, it is cropped or set to one of the wordpress […]

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 WordPress: function sanitize_file_uploads( $file ){ $file[‘name’] = sanitize_file_name($file[‘name’]); $file[‘name’] = preg_replace(“/[^a-zA-Z0-9\_\-\.]/”, “”, $file[‘name’]); $file[‘name’] = strtolower($file[‘name’]); add_filter(‘sanitize_file_name’, ‘remove_accents’); return $file; } add_filter(‘wp_handle_upload_prefilter’, ‘sanitize_file_uploads’); […]

Generate fixed image sizes for different pages, eliminate sizes during upload

I’ve built a few sites in WordPress and in general I’m quite pleased with all the possibilities it has developed lately. There’s one main thing that is utterly confusing for end users; the sizes they have to choose when using an image. They really do not understand the concept of pixels, and then they also […]

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 and just save the original gif. Someone that can help me out with this? Which filter to use will be a […]

Allow user to manually set crop area of default/custom image sizes on upload

I’m looking for a plugin that allows the user to define where the image will be cropped for a given thumbnail size. For example, the user uploads an image, a screen comes up with the image and a selection box, and asks her to move/resize the image within the selection for size ‘medium’. I’ve found […]

How to resize image on client-side before upload?

I’ve been using Plupload to resize images on the client side before uploading them to the server. I’ve implemented a front-end form which lets the user select a file from their computer and submit it. My Plupload config looks like this: var uploader = new plupload.Uploader({ browse_button: ‘browse’, url: $url, resize: { width: 100, height: […]

How can i use wp_get_image_editor for image resizing

I search a lot that how can i re-size images that upload with meta field but i get nothing instead of wp_get_image_editor. I read from codex about it but nothing helpful so I search about this function and found these links WordPress Image Editing Tutorial (WP_Image_Editor Class Examples) but it also not usefull for […]

Using wp_get_image_editor in a standalone script

With WP 3.5, they updated the image resizing scripts with wp_get_image_editor. Currently, in this standalone script that is accessed with Ajax, I have included wp-load.php so I can access all of the WP functions. Particularly, $wpdb;. In order to use the $wpdb functions, I had to declare global $wpdb; first. I assumed I had to […]