QQWorld Auto Save Images - Version 1.7.12.10

Version Description

Download this release

Release Info

Developer qqworld
Plugin Icon 128x128 QQWorld Auto Save Images
Version 1.7.12.10
Comparing to
See all releases

Code changes from version 1.7.12.9 to 1.7.12.10

Files changed (1) hide show
  1. qqworld-auto-save-images.php +7 -4
qqworld-auto-save-images.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: QQWorld Auto Save Images
4
  Plugin URI: https://wordpress.org/plugins/qqworld-auto-save-images/
5
  Description: Automatically keep the all remote picture to the local, and automatically set featured image.
6
- Version: 1.7.12.9
7
  Author: Michael Wang
8
  Author URI: http://www.qqworld.org
9
  Text Domain: qqworld_auto_save_images
@@ -1013,7 +1013,8 @@ class QQWorld_auto_save_images {
1013
  }
1014
  // check pictrue size
1015
  list($width, $height, $type, $attr) = @getimagesize($image_url);
1016
- if ($width<$this->minimum_picture_size['width'] || $height<$this->minimum_picture_size['height']) $allow = false;
 
1017
  // check if remote image
1018
  if ($allow) {
1019
  $pos = strpos($image_url, get_bloginfo('url'));
@@ -1243,8 +1244,9 @@ class QQWorld_auto_save_images {
1243
  if (function_exists('file_get_contents')) {
1244
  $file = @file_get_contents($image_url);
1245
  }
 
1246
  // curl
1247
- if (empty($file) && function_exists('curl_init')) {
1248
  $ch = curl_init();
1249
  $timeout = 5;
1250
  curl_setopt($ch, CURLOPT_URL, $image_url);
@@ -1252,8 +1254,9 @@ class QQWorld_auto_save_images {
1252
  $file = curl_exec($ch);
1253
  curl_close($ch);
1254
  }
 
1255
  // GD
1256
- if (empty($file) && function_exists('fsockopen')) {
1257
  $type = $this->fsockopen_image_header($image_url);
1258
  if ($type && in_array($type, array('image/jpeg', 'image/gif', 'image/png'))) {
1259
  $type = substr($type, 6);
3
  Plugin Name: QQWorld Auto Save Images
4
  Plugin URI: https://wordpress.org/plugins/qqworld-auto-save-images/
5
  Description: Automatically keep the all remote picture to the local, and automatically set featured image.
6
+ Version: 1.7.12.10
7
  Author: Michael Wang
8
  Author URI: http://www.qqworld.org
9
  Text Domain: qqworld_auto_save_images
1013
  }
1014
  // check pictrue size
1015
  list($width, $height, $type, $attr) = @getimagesize($image_url);
1016
+
1017
+ if ($width != NULL && ($width<$this->minimum_picture_size['width'] || $height<$this->minimum_picture_size['height'])) $allow = false;
1018
  // check if remote image
1019
  if ($allow) {
1020
  $pos = strpos($image_url, get_bloginfo('url'));
1244
  if (function_exists('file_get_contents')) {
1245
  $file = @file_get_contents($image_url);
1246
  }
1247
+
1248
  // curl
1249
+ if (!$file && function_exists('curl_init')) {
1250
  $ch = curl_init();
1251
  $timeout = 5;
1252
  curl_setopt($ch, CURLOPT_URL, $image_url);
1254
  $file = curl_exec($ch);
1255
  curl_close($ch);
1256
  }
1257
+ $img = @imagecreatefromstring($file);
1258
  // GD
1259
+ if (!$img && function_exists('fsockopen')) {
1260
  $type = $this->fsockopen_image_header($image_url);
1261
  if ($type && in_array($type, array('image/jpeg', 'image/gif', 'image/png'))) {
1262
  $type = substr($type, 6);