diff --git a/just-responsive-images.php b/just-responsive-images.php index 1da014f..f7d96a0 100644 --- a/just-responsive-images.php +++ b/just-responsive-images.php @@ -4,7 +4,7 @@ Plugin Name: Just Responsive Images Description: Providing full control to set your own responsive image properties for WordPress 4.4+, the ability to use the <picture> tag, auto-generate image backgrounds and supports retina images. Tags: responsive post thumbnail, post thumbnail as background, retina support, retina image, retina post thumbnail, responsive post attachment, responsive images, responsive attachments, post thumbnails, media -Version: 1.6.1 +Version: 1.6.2 Author: JustCoded / Alex Prokopenko Author URI: http://justcoded.com/ License: GPL3 @@ -49,7 +49,7 @@ class JustResponsiveImages extends core\Singleton { protected function __construct() { // init plugin name and version. self::$plugin_name = __( 'Just Responsive Images', JustResponsiveImages::TEXTDOMAIN ); - self::$version = '1.610'; + self::$version = '1.620'; // init features, which this plugin is created for. new components\Maintenance(); diff --git a/models/RwdImage.php b/models/RwdImage.php index 2abd5bb..bf661c7 100644 --- a/models/RwdImage.php +++ b/models/RwdImage.php @@ -472,7 +472,7 @@ public function get_set_sources() { $option->size->h, $option->size->crop ); - if ( JRI_DUMMY_IMAGE && empty( $meta_data['sizes'][ $option->key ]['file'] ) ) { + if ( JRI_DUMMY_IMAGE && empty( $meta_data['sizes'][ $option->key ]['valid'] ) ) { $dummy_sizes[ $option->key ] = $this->dummy_source( $option, false, $attachment->ID, $meta_data ); } @@ -489,7 +489,7 @@ public function get_set_sources() { $option->size->crop ); - if ( JRI_DUMMY_IMAGE && empty( $meta_data['sizes'][ $retina_image_size ]['file'] ) ) { + if ( JRI_DUMMY_IMAGE && empty( $meta_data['sizes'][ $retina_image_size ]['valid'] ) ) { $dummy_sizes[ $retina_image_size ] = $this->dummy_source( $option, $multiplier, $attachment->ID, $meta_data ); } } @@ -585,12 +585,15 @@ public function resize_image( $attach_id, $meta_data, $key, $width, $height, $cr $upload_dir = wp_get_upload_dir(); $image_baseurl = $upload_dir['basedir'] . DIRECTORY_SEPARATOR . image_get_intermediate_size( $attach_id, $key )['path']; + $meta_data['sizes'][ $key ]['valid'] = true; + if ( ! file_exists( $image_baseurl ) || ! isset( $meta_data['sizes'][ $key ]['rwd_width'] ) || $meta_data['sizes'][ $key ]['rwd_width'] !== $width || $meta_data['sizes'][ $key ]['rwd_height'] !== $height || ( 0 !== strcmp( $crop_str, $meta_data['sizes'][ $key ]['crop'] ) ) ) { // in dummy mode we do not resize anything. if ( JRI_DUMMY_IMAGE ) { + $meta_data['sizes'][ $key ]['valid'] = false; return $meta_data; } diff --git a/readme.txt b/readme.txt index ddef25e..48ca658 100644 --- a/readme.txt +++ b/readme.txt @@ -90,6 +90,8 @@ There are no any special upgrade instructions for version 1.0 - 1.3 To upgrade remove the old plugin folder. After than follow the installation steps 1-2. == Changelog == += Version 1.6.2 - 3 July 2018 = + * Fix dev mode dummy images with sizes set in DB but missing on file system. = Version 1.6.1 - 28 June 2018 = * Added attachment ID text to dev mode dummy images. = Version 1.6.0 - 27 June 2018 =