Skip to content

Commit 4b97998

Browse files
committed
v1.3.0
- minor code changes
1 parent 90af0cd commit 4b97998

File tree

7 files changed

+56
-33
lines changed

7 files changed

+56
-33
lines changed

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
This extension is a further development of [canonknipser](https://www.phpbb.com/customise/db/author/canonknipser) [ImageMagick Thumbnailer](https://www.phpbb.com/customise/db/extension/imagemagick_thumbnailer).
55
The extension uses the PHP imagick class to modify uploaded images, thumbnails and avatars. It shows a preview image in attachments upload. If the values set in the ACP are exceeded by the image file, the image is being resized by the extension.
66
The extension supports JPEG, WEBP, GIF and PNG images. Other image formats, for example BMP, are converted to JPEG when resized.
7-
This extension can change the image size and/or the image file size. It rotate images, thumbnails and avatars according to their EXIF information and it can remove the EXIF data from JPEG and WEBP files.
7+
This extension can change the image size and/or the image file size. It rotate images, thumbnails and avatars according to their EXIF information and it can remove the EXIF data from JPEG and WEBP files. Images and thumbnails can also be rotated manually.
88

99
#### Settings in User Control Panel
1010
- No settings.
@@ -54,8 +54,11 @@ For full functionality "Maximum avatar file size" in "ACP" > "Board configuratio
5454

5555
## Changelog
5656

57+
### v1.3.0 (13-10-2023)
58+
- Added manual image rotation
59+
5760
### v1.2.2 (29-07-2023)
58-
- Conside BBCode Settings
61+
- BBCode settings considered
5962
- Fixed scrollbar on large images in attachbox
6063
- Fixed button misaligned
6164

imcger/imgupload/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
This extension is a further development of [canonknipser](https://www.phpbb.com/customise/db/author/canonknipser) [ImageMagick Thumbnailer](https://www.phpbb.com/customise/db/extension/imagemagick_thumbnailer).
55
The extension uses the PHP imagick class to modify uploaded images, thumbnails and avatars. It shows a preview image in attachments upload. If the values set in the ACP are exceeded by the image file, the image is being resized by the extension.
66
The extension supports JPEG, WEBP, GIF and PNG images. Other image formats, for example BMP, are converted to JPEG when resized.
7-
This extension can change the image size and/or the image file size. It rotate images, thumbnails and avatars according to their EXIF information and it can remove the EXIF data from JPEG and WEBP files.
7+
This extension can change the image size and/or the image file size. It rotate images, thumbnails and avatars according to their EXIF information and it can remove the EXIF data from JPEG and WEBP files. Images and thumbnails can also be rotated manually.
88

99
#### Settings in User Control Panel
1010
- No settings.
@@ -54,6 +54,9 @@ For full functionality "Maximum avatar file size" in "ACP" > "Board configuratio
5454

5555
## Changelog
5656

57+
### v1.3.0 (13-10-2023)
58+
- Added manual image rotation
59+
5760
### v1.2.2 (29-07-2023)
5861
- Conside BBCode Settings
5962
- Fixed scrollbar on large images in attachbox

imcger/imgupload/composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
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.3.0-b2",
7-
"time": "2023-10-08",
6+
"version": "1.3.0",
7+
"time": "2023-10-13",
88
"license": "GPL-2.0-only",
99
"authors": [
1010
{

imcger/imgupload/controller/save_rotated_img_controller.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99

1010
namespace imcger\imgupload\controller;
1111

12+
/**
13+
* @ignore
14+
*/
1215
use Symfony\Component\HttpFoundation\JsonResponse;
1316

1417
/**

imcger/imgupload/event/main_listener.php

Lines changed: 33 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -507,19 +507,23 @@ function set_image_format($image, $mimetype)
507507
{
508508
case 'image/jpeg':
509509
$imageformat = 'JPEG';
510-
break;
510+
break;
511+
511512
case 'image/png':
512513
$imageformat = 'PNG';
513-
break;
514+
break;
515+
514516
case 'image/gif':
515517
$imageformat = 'GIF';
516-
break;
518+
break;
519+
517520
case 'image/webp':
518521
$imageformat = 'WEBP';
519-
break;
522+
break;
523+
520524
default:
521525
$imageformat = 'JPEG';
522-
break;
526+
break;
523527
}
524528

525529
$image->setImageFormat($imageformat);
@@ -542,23 +546,24 @@ function set_image_compression($image, $quality = 80)
542546
case 'JPEG':
543547
$image->setImageCompression(\Imagick::COMPRESSION_JPEG);
544548
$image->setImageCompressionQuality($quality);
545-
break;
549+
break;
546550

547551
case 'PNG':
548552
$image->setOption('png:compression-strategy', 1);
549553
$image->setOption('png:compression-filter', 5);
550554
$image->setOption('png:compression-level', 9);
551-
break;
555+
$image->setImageType(\Imagick::IMGTYPE_PALETTEMATTE);
556+
break;
552557

553558
case 'WEBP':
554559
$image->setOption('webp:alpha-compression', 1);
555560
$image->setOption('webp:method', 6);
556561
$image->setImageCompressionQuality($quality);
557-
break;
562+
break;
558563

559564
default:
560565
// do nothing
561-
break;
566+
break;
562567
}
563568
}
564569

@@ -587,40 +592,49 @@ function image_auto_rotate($image)
587592
case \Imagick::ORIENTATION_UNDEFINED:
588593
// do nothing
589594
$is_changed = false;
590-
break;
595+
break;
596+
591597
case \Imagick::ORIENTATION_TOPLEFT:
592598
// do nothing
593599
$is_changed = false;
594-
break;
600+
break;
601+
595602
case \Imagick::ORIENTATION_TOPRIGHT:
596603
$image->flopImage();
597-
break;
604+
break;
605+
598606
case \Imagick::ORIENTATION_BOTTOMRIGHT:
599607
$image->rotateImage("#000", 180);
600-
break;
608+
break;
609+
601610
case \Imagick::ORIENTATION_BOTTOMLEFT:
602611
$image->flipImage();
603-
break;
612+
break;
613+
604614
case \Imagick::ORIENTATION_LEFTTOP:
605615
$image->transposeImage();
606616
$is_rotate = true;
607-
break;
617+
break;
618+
608619
case \Imagick::ORIENTATION_RIGHTTOP:
609620
$image->rotateImage("#000", 90);
610621
$is_rotate = true;
611-
break;
622+
break;
623+
612624
case \Imagick::ORIENTATION_RIGHTBOTTOM:
613625
$image->transverseImage();
614626
$is_rotate = true;
615-
break;
627+
break;
628+
616629
case \Imagick::ORIENTATION_LEFTBOTTOM:
617630
$image->rotateImage("#000", 270);
618631
$is_rotate = true;
619-
break;
632+
break;
633+
620634
default:
621635
// do nothing
622636
$is_changed = false;
623-
break;
637+
break;
624638
}
625639

626640
// set the orientation from the Image

imcger/imgupload/styles/all/template/event/overall_footer_body_after.html

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -140,18 +140,18 @@
140140
deg_ziel = deg == 0 ? 360 : deg;
141141
deg_start = deg_ziel - 90;
142142
} else {
143-
deg_ziel = (deg - 360) == (-360) ? 0 : (deg - 360);
143+
deg_ziel = deg == 0 ? 0 : deg - 360;
144144
deg_start = deg_ziel + 90;
145145
}
146146

147147
image.animate(
148-
[
149-
{ transform: 'rotate(' + deg_start + 'deg)' },
150-
{ transform: 'rotate(' + deg_ziel + 'deg)' },
151-
],
152-
{
153-
duration: 150,
154-
},
148+
[
149+
{ transform: 'rotate(' + deg_start + 'deg)' },
150+
{ transform: 'rotate(' + deg_ziel + 'deg)' },
151+
],
152+
{
153+
duration: 150,
154+
},
155155
);
156156

157157
image.style.webkitTransform = 'rotate(' + deg + 'deg)';

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.2.2",
4+
"current": "1.3.0",
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)