Skip to content

Commit

Permalink
handle failure to get image dimensions in thumb updater tool
Browse files Browse the repository at this point in the history
  • Loading branch information
ron4mac committed Feb 2, 2022
1 parent bbd2ed8 commit 70aa501
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Changelog
[S] = Security fix (issues that are related to security)
*********************************************

2022-02-02 [B] Handle failure to get image dimensions in thumb updater tool {ron4mac}
2021-11-22 [B] Allow ratings from different logged in users regardless of IP address {ron4mac}
2021-11-20 [M] Update third party (ZenPhoto maintained) exif reader {ron4mac}
2021-11-15 [M] Change bridge file for SMF 2.1 to function with latest SMF version {ron4mac}
Expand Down
4 changes: 2 additions & 2 deletions include/cpg16x.files.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<file_data>
<element>
<fullpath>CHANGELOG.txt</fullpath>
<version>1.6.16</version>
<version>1.6.17</version>
<status>optional</status>
<permission>read</permission>
<hash>5e0e634d953531ceb89ae1ecf2b51496</hash>
Expand Down Expand Up @@ -9248,7 +9248,7 @@
</element>
<element>
<fullpath>tools/upd_thumbs/upd_thumbs.php</fullpath>
<version>1.6.06</version>
<version>1.6.17</version>
<status>optional</status>
<permission>read</permission>
<hash>7a53f53f2db7377dad051f2c5babd7d4</hash>
Expand Down
9 changes: 7 additions & 2 deletions tools/upd_thumbs/upd_thumbs.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
*
* v1.0 originally written by Gregory Demar
*
* @copyright Copyright (c) 2003-2018 Coppermine Dev Team
* @copyright Copyright (c) 2003-2022 Coppermine Dev Team
* @license GNU General Public License version 3 or later; see LICENSE
*
* tools/upd_thumbs/upd_thumbs.php
* @since 1.6.06
* @since 1.6.17
*/

/* declare each item separately - not as an entire array() */
Expand Down Expand Up @@ -104,6 +104,11 @@ public function process ()
}

$imagesize = cpg_getimagesize($work_image);
if (!$imagesize[0] || !$imagesize[1]) {
echo $this->_('filesize_error') . ' <tt>' . $work_image .'</tt><br>';
$this->errcnt++;
continue;
}

if ($updatetype == 3 || $updatetype == 4 || $updatetype == 5) {
// resize full-sized picture without watermark (will be applied later) if it's bigger than the max width or height for uploaded pictures
Expand Down

0 comments on commit 70aa501

Please sign in to comment.