I'm trying to programmatically increase the size of images that are uploaded. I want to double the size of each image. The code I've written so far is:
$pathDirectory = dirname( $imagePath ); $large_w = $width*2; // These values are correct $large_h = $height*2; // These values are correct $largeImage = wp_get_image_editor( $imagePath ); $largeFilename = $largeImage->generate_filename("large", $pathDirectory, $ext); $largeImage->set_quality(100); $largeImage->resize($large_w, $large_h, false); $largeImage->save($largeFilename);
This is making an image with the '-large' bit in the filename but it's exactly the same size as the original image. After reading the WP manual is says regarding resize:
resize( $max_w, $max_h, $crop = false ) // NOTE - max width and max height Resizes current image.
So I'm thinking that resize only makes images smaller?
Am I right in assuming this and, if so, how do I make images bigger with WP?
Thanks for your help :-)