Skip to content

Commit

Permalink
fixed s3 integration when using API
Browse files Browse the repository at this point in the history
  • Loading branch information
nosilver4u committed Jul 8, 2017
1 parent b9fbc47 commit 7df7a14
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
1 change: 0 additions & 1 deletion classes/class-ewwwio-imagick-editor.php
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,6 @@ protected function _save( $image, $filename = null, $mime_type = null ) {
}
global $s3_uploads_image;
$s3_uploads_image = $filename;
ewwwio_debug_message( "image editor (s3 uploads) working on: $filename" );
if ( ! defined( 'EWWW_IMAGE_OPTIMIZER_CLOUD' ) ) {
ewww_image_optimizer_cloud_init();
}
Expand Down
3 changes: 1 addition & 2 deletions common.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
// TODO: need to make the scheduler so it can resume without having to re-run the queue population, and then we can probably also flush the queue when scheduled opt starts, but later it would be nice to implement the bulk_loop as the aux_loop so that it could handle media properly.
// TODO: implement a search for the bulk table, or maybe we should just move it to it's own page?
// TODO: port bulk changes to NextGEN and FlaGallery.
// TODO: extend custom WP_Image_Editor class from s3 uploader plugin on github.
// TODO: make a bulk restore function.
// TODO: Add a custom async function for parallel mode to store image as pending and use the row ID instead of relative path.
// TODO: write some tests for update_table and check_table, find_already_opt, and remove_dups.
Expand Down Expand Up @@ -3833,7 +3832,7 @@ function ewww_image_optimizer_update_table( $attachment, $opt_size, $orig_size,
global $s3_uploads_image;
if ( class_exists( 'S3_Uploads' ) && ! empty( $s3_uploads_image ) && $s3_uploads_image != $attachment ) {
$attachment = $s3_uploads_image;
ewwwio_debug_message( "overriding check with: $attachment" );
ewwwio_debug_message( "overriding update with: $attachment" );
}
$already_optimized = ewww_image_optimizer_find_already_optimized( $attachment );
if ( is_array( $already_optimized ) && ! empty( $already_optimized['converted'] ) ) {
Expand Down
2 changes: 1 addition & 1 deletion unique.php
Original file line number Diff line number Diff line change
Expand Up @@ -1540,7 +1540,7 @@ function ewww_image_optimizer( $file, $gallery_type = 4, $converted = false, $ne
if ( empty( $s3_uploads_image ) ) {
$s3_uploads_image = false;
}
if ( strpos( $file, 's3' ) === 0 && class_exists( 'S3_Uploads' ) && ! EWWW_IMAGE_OPTIMIZER_CLOUD ) {
if ( strpos( $file, 's3' ) === 0 && class_exists( 'S3_Uploads' ) ) {
$s3_uploads_image = $file;
$s3_uploads_instance = S3_Uploads::get_instance();
$s3_uploads_instance->setup();
Expand Down

0 comments on commit 7df7a14

Please sign in to comment.