From e8918ca149f9eb0ea4148431772b9e5090f3ea7f Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Fri, 21 Jun 2019 22:27:27 +0200 Subject: Respect photo thumbnails storage in import --- include/photo/photo_driver.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/photo/photo_driver.php b/include/photo/photo_driver.php index c11580bdc..2ca3acf7d 100644 --- a/include/photo/photo_driver.php +++ b/include/photo/photo_driver.php @@ -371,21 +371,19 @@ function import_channel_photo($photo, $type, $aid, $uid) { // photo size $img->scaleImageSquare(300); - $r = $img->save($p); + $r = $img->storeThumbnail($p, PHOTO_RES_PROFILE_300); if($r === false) $photo_failure = true; // thumb size $img->scaleImage(80); - $p['imgscale'] = 5; - $r = $img->save($p); + $r = $img->storeThumbnail($p, PHOTO_RES_PROFILE_80); if($r === false) $photo_failure = true; // micro size $img->scaleImage(48); - $p['imgscale'] = 6; - $r = $img->save($p); + $r = $img->storeThumbnail($p, PHOTO_RES_PROFILE_48); if($r === false) $photo_failure = true; -- cgit v1.2.3 From 8730bbac2fd93a9ddc9922f7fed3d89abad1eccc Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Fri, 21 Jun 2019 22:42:38 +0200 Subject: Revert "Respect photo thumbnails storage in import" This reverts commit e8918ca149f9eb0ea4148431772b9e5090f3ea7f --- include/photo/photo_driver.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/photo/photo_driver.php b/include/photo/photo_driver.php index 2ca3acf7d..c11580bdc 100644 --- a/include/photo/photo_driver.php +++ b/include/photo/photo_driver.php @@ -371,19 +371,21 @@ function import_channel_photo($photo, $type, $aid, $uid) { // photo size $img->scaleImageSquare(300); - $r = $img->storeThumbnail($p, PHOTO_RES_PROFILE_300); + $r = $img->save($p); if($r === false) $photo_failure = true; // thumb size $img->scaleImage(80); - $r = $img->storeThumbnail($p, PHOTO_RES_PROFILE_80); + $p['imgscale'] = 5; + $r = $img->save($p); if($r === false) $photo_failure = true; // micro size $img->scaleImage(48); - $r = $img->storeThumbnail($p, PHOTO_RES_PROFILE_48); + $p['imgscale'] = 6; + $r = $img->save($p); if($r === false) $photo_failure = true; -- cgit v1.2.3 From b1b415ec5b46f56a335a31527c9f987854be7282 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Fri, 21 Jun 2019 23:15:16 +0200 Subject: Fix thumbnails processing logic on files sync --- include/import.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/import.php b/include/import.php index 24ad1b901..caf25f5d2 100644 --- a/include/import.php +++ b/include/import.php @@ -1390,7 +1390,7 @@ function sync_files($channel, $files) { $p['content'] = (($p['content'])? base64_decode($p['content']) : ''); } - if (intval($p['imgscale']) && ((intval($p['os_storage'])) || (! $p['content']))) { + if(intval($p['imgscale'])) { $time = datetime_convert(); -- cgit v1.2.3