Skip to content

Commit

Permalink
Merge pull request #35 from wp-media/branch-1.5.9
Browse files Browse the repository at this point in the history
1.5.9
  • Loading branch information
GeekPress authored Sep 26, 2016
2 parents a5a7afb + 703f944 commit e1571b0
Show file tree
Hide file tree
Showing 17 changed files with 2,000 additions and 1,768 deletions.
2 changes: 1 addition & 1 deletion imagify.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Plugin Name: Imagify
Plugin URI: https://wordpress.org/plugins/imagify/
Description: Dramaticaly reduce image file sizes without losing quality, make your website load faster, boost your SEO and save money on your bandwith using Imagify, the new most advanced image optimization tool.
Version: 1.5.8
Version: 1.5.9
Author: WP Media
Author URI: http://wp-media.me
Licence: GPLv2
Expand Down
15 changes: 8 additions & 7 deletions inc/3rd-party/nextgen-gallery/inc/classes/class-attachment.php
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,14 @@ public function optimize( $optimization_level = null, $metadata = array() ) {
'percent' => 0,
)
);


// To avoid issue with "original_size" at 0 in "_imagify_data"
if ( 0 === $this->get_stats_data( 'original_size' ) ) {
delete_post_meta( $id, '_imagify_data' );
delete_post_meta( $id, '_imagify_status' );
delete_post_meta( $id, '_imagify_optimization_level' );
}

// Get file path & URL for original image
$attachment_path = $this->get_original_path();
$attachment_url = $this->get_original_url();
Expand All @@ -252,12 +259,6 @@ public function optimize( $optimization_level = null, $metadata = array() ) {
return;
}

// To avoid issue with "original_size" at 0 in "_imagify_data"
if ( 0 === $this->get_stats_data( 'original_size' ) ) {
delete_post_meta( $id, '_imagify_data' );
delete_post_meta( $id, '_imagify_status' );
}

/**
* Fires before optimizing an attachment.
*
Expand Down
2 changes: 1 addition & 1 deletion inc/admin/ui/bulk.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ function _imagify_display_bulk_page() {
</p>
</div>
<div class="imagify-cell imagify-pl0">
<p class="imagify-info-block"><?php printf( __( 'All images greater than %s will be optimized when using a paying monthly plan.', 'imagify' ), size_format( get_imagify_max_image_size() ) ); ?></p>
<p class="imagify-info-block"><?php printf( __( 'All images greater than %s will be optimized when using a paid plan.', 'imagify' ), size_format( get_imagify_max_image_size() ) ); ?></p>
</div>
</div>
</div>
Expand Down
10 changes: 8 additions & 2 deletions inc/classes/abstracts/abstract-attachment.php
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,9 @@ public function restore() {}
* @return string Path the the resized image or the original image if the resize failed
*/
function resize( $attachment_path, $attachment_sizes, $max_width ) {
// Prevent removal of the exif/meta data when resizing (only works with Imagick)
add_filter( 'image_strip_meta', '__return_false' );

$new_sizes = wp_constrain_dimensions( $attachment_sizes[0], $attachment_sizes[1], $max_width );

$editor = wp_get_image_editor( $attachment_path );
Expand Down Expand Up @@ -427,14 +430,17 @@ function resize( $attachment_path, $attachment_sizes, $max_width ) {
return $resized;
}

$resized_image_path = $editor->generate_filename( null );
$resized_image_path = $editor->generate_filename( 'imagifyresized' );

$resized_image_saved = $editor->save( $resized_image_path );

if ( is_wp_error( $resized_image_saved ) ) {
return $resized_image_saved;
}


// Remove the filter when we're done to prevent any conflict
remove_filter( 'image_strip_meta', '__return_false' );

return $resized_image_path;
}
}
15 changes: 8 additions & 7 deletions inc/classes/class-attachment.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,14 @@ public function optimize( $optimization_level = null, $metadata = array() ) {
'percent' => 0,
)
);


// To avoid issue with "original_size" at 0 in "_imagify_data"
if ( 0 === $this->get_stats_data( 'original_size' ) ) {
delete_post_meta( $id, '_imagify_data' );
delete_post_meta( $id, '_imagify_status' );
delete_post_meta( $id, '_imagify_optimization_level' );
}

// Get file path & URL for original image
$attachment_path = $this->get_original_path();
$attachment_url = $this->get_original_url();
Expand All @@ -213,12 +220,6 @@ public function optimize( $optimization_level = null, $metadata = array() ) {
return;
}

// To avoid issue with "original_size" at 0 in "_imagify_data"
if ( 0 === $this->get_stats_data( 'original_size' ) ) {
delete_post_meta( $id, '_imagify_data' );
delete_post_meta( $id, '_imagify_status' );
}

/**
* Fires before optimizing an attachment.
*
Expand Down
Binary file modified languages/imagify-de_DE.mo
Binary file not shown.
Loading

0 comments on commit e1571b0

Please sign in to comment.