• Hi all,

    I just noticed the following when uploading a .JPG file to my theme.
    I’m using the following code to resize it, the code works fine in all cases except when the filetype is .JPG(uppercase) instead of .jpg (lowercase).

    When it’s uppercase the file get’s uploaded but not resized.

    Is there anything I need to add, configure etc.. or is this a known bug?

    Here is my code snippet:

    //for resizing
    						if ( $movefile ) {
    						if ($_FILES['blog']['name'][$kk] == $_FILES['blog']['name']['logo']) {$width = 311; $height = 103;}
    						if ($_FILES['blog']['name'][$kk] == $_FILES['blog']['name']['pimg']) {$width = 200; $height = 200;}
    						if ($_FILES['blog']['name'][$kk] == $_FILES['blog']['name']['mp']) {$width = 285; $height = 460;}
    						if ($_FILES['blog']['name'][$kk] == $_FILES['blog']['name']['headp']) {$width = 380; $height = 205;}
                            $image = wp_get_image_editor($pathfile); // Return an implementation that extends <tt>WP_Image_Editor</tt>
                            if ( ! is_wp_error( $image ) ) {
                            //$image->rotate( 90 );
                            $image->resize( $width, $height, false );
                            $image->save( $pathfile );
                            }
                            echo "File is valid, and was successfully uploaded.\n";
    						var_dump($movefile);
    						} else {
                            echo "Possible file upload attack!\n";
                            }

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘WP_Image_Editor not working with uppercase filetypes’ is closed to new replies.