Skip to content

Commit 4b53937

Browse files
committed
v1.4.5-pl1
1 parent c5f60f4 commit 4b53937

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

imcger/imgupload/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"type": "phpbb-extension",
44
"description": "Using ImageMagick php librarie for resize image attachments and creating thumbnails.",
55
"homepage": "https://github.com/IMC-GER/phpBB-Image-upload-use-ImageMagick/tags",
6-
"version": "1.4.5",
6+
"version": "1.4.5-pl1",
77
"time": "2024-06-23",
88
"license": "GPL-2.0-only",
99
"authors": [

imcger/imgupload/controller/ajax_controller.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,15 +231,21 @@ private function save_image($img_attach_id, $img_rotate_deg)
231231
*/
232232
private function image_size($attach_id)
233233
{
234-
$sql = 'SELECT filesize
234+
$sql = 'SELECT physical_filename
235235
FROM ' . ATTACHMENTS_TABLE . '
236236
WHERE attach_id = ' . (int) $attach_id;
237237

238238
$result = $this->db->sql_query($sql);
239239
$img_data = $this->db->sql_fetchrow($result);
240240
$this->db->sql_freeresult($result);
241241

242-
$this->json_response(0, $this->ext_display_name, '', $attach_id, $attach_id, $img_data['filesize']);
242+
$file_path = join('/', [trim($this->config['upload_path'], '/'), trim($img_data['physical_filename'], '/')]);
243+
244+
$image = new \Imagick($file_path);
245+
$filesize = strlen($image->getImageBlob());
246+
$image->clear();
247+
248+
$this->json_response(0, $this->ext_display_name, '', $attach_id, $attach_id, $filesize);
243249
}
244250

245251
/**

imgupload_version.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"stable": {
33
"1.0": {
4-
"current": "1.4.5",
4+
"current": "1.4.5-pl1",
55
"announcement": "https://www.phpbb.de/community/viewtopic.php?t=246009",
66
"download": "https://github.com/IMC-GER/phpBB-Image-upload-use-ImageMagick/tags",
77
"eol": null,

0 commit comments

Comments
 (0)