Loading inc/class-s3-uploads-image-editor-imagick.php +6 −2 Original line number Diff line number Diff line Loading @@ -21,8 +21,12 @@ class S3_Uploads_Image_Editor_Imagick extends WP_Image_Editor_Imagick { $save = parent::_save( $image, $temp_filename, $mime_type ); if ( ! is_wp_error( $save ) ) { copy( $temp_filename, $filename ); if ( is_wp_error( $save ) ) { return $save; } if ( ! copy( $save['path'], $filename ) ) { return new WP_Error( 'unable-to-copy-to-s3', 'Unable to copy the temp image to S3' ); } return array( Loading tests/test-s3-uploads-image-editor-imagick.php +12 −0 Original line number Diff line number Diff line Loading @@ -55,5 +55,17 @@ class Test_S3_Uploads_Image_Editor_Imagick extends WP_UnitTestCase { $this->assertEquals( 'canola-100x100.jpg', $status['file'] ); $this->assertEquals( 100, $status['width'] ); $this->assertEquals( 100, $status['height'] ); $image = getimagesize( $status['path'] ); $this->assertEquals( array( 100, 100, 2, 'width="100" height="100"', 'bits' => 8, 'channels' => 3, 'mime' => 'image/jpeg' ), $image ); } } No newline at end of file Loading
inc/class-s3-uploads-image-editor-imagick.php +6 −2 Original line number Diff line number Diff line Loading @@ -21,8 +21,12 @@ class S3_Uploads_Image_Editor_Imagick extends WP_Image_Editor_Imagick { $save = parent::_save( $image, $temp_filename, $mime_type ); if ( ! is_wp_error( $save ) ) { copy( $temp_filename, $filename ); if ( is_wp_error( $save ) ) { return $save; } if ( ! copy( $save['path'], $filename ) ) { return new WP_Error( 'unable-to-copy-to-s3', 'Unable to copy the temp image to S3' ); } return array( Loading
tests/test-s3-uploads-image-editor-imagick.php +12 −0 Original line number Diff line number Diff line Loading @@ -55,5 +55,17 @@ class Test_S3_Uploads_Image_Editor_Imagick extends WP_UnitTestCase { $this->assertEquals( 'canola-100x100.jpg', $status['file'] ); $this->assertEquals( 100, $status['width'] ); $this->assertEquals( 100, $status['height'] ); $image = getimagesize( $status['path'] ); $this->assertEquals( array( 100, 100, 2, 'width="100" height="100"', 'bits' => 8, 'channels' => 3, 'mime' => 'image/jpeg' ), $image ); } } No newline at end of file