[3.2][3.3][RC] Attachments images rotation extension - dev/bugs logs

A place for Extension Authors to post and receive feedback on Extensions still in development. No Extensions within this forum should be used within a live environment!
Ideas Centre
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: Extensions Development rules

IMPORTANT FOR NEEDED EVENTS!!!
If you need an event for your extension please read this for the steps to follow to request the event(s)
User avatar
HaioPaio
Registered User
Posts: 265
Joined: Mon Jan 08, 2018 7:39 pm

Re: [3.2][3.3][RC] Attachments images rotation extension - dev/bugs logs

Post by HaioPaio »

I have tested it with Macbook and Phone7. It works fine as expected.

May I suggest to change the entry in composer.json from 1.0.4 to 1.0.4.2 in order to properly display the version in ACP/Customize?
www.der-räuchertreff.de phpBB 3.3.x php 7.4
User avatar
axe70
Registered User
Posts: 751
Joined: Sun Nov 17, 2002 10:55 am
Location: Italy
Name: Alessio

Re: [3.2][3.3][RC] Attachments images rotation extension - dev/bugs logs

Post by axe70 »

Going! Thank you. Github is quite and still is an half mystery to me, sorry! :D
(even it is my forgotten, and not a github skill i should have)
Do not take me too serious
Anyway i do not like Discourse
exxos
Registered User
Posts: 139
Joined: Fri Sep 10, 2010 12:37 pm

Re: [3.2][3.3][RC] Attachments images rotation extension - dev/bugs logs

Post by exxos »

Oh wow this extension is great! Years people have been asking to sort out the image rotation issue and now there is finally a fix! THANK-YOU! :D

Maybe a feature request for another time.. A tick box to enable / disable image resizing as set in the ACP. All my images are resized to a maximum 1600px wide. But sometimes it's useful to upload full resolution images. Currently there is no way I know of to allow a user to "bypass" the forced 1600px limit I have set.

I cannot simply allow high-resolution images permanently because people were uploading like 50MB image sizes :roll: Hence I put a maximum of 1600px wide. But sometimes full resolution is needed if someone is selling something which does require extreme detail. So it's a good on tick a box to allow that to happen then that would also be a great feature.

Of course this assumes users do not abuse the function. But Generally people are to lazy to untick a box to allow full resolution anyway, so I don't see it as a problem :lol:
foxiedog
Registered User
Posts: 13
Joined: Fri Jul 31, 2020 10:26 am

Re: [3.2][3.3][RC] Attachments images rotation extension - dev/bugs logs

Post by foxiedog »

on my test forum, i'm getting the "no permissions" error when trying to rotate any images, both as admin and member,
the image rotates, but will not save,
while on my live forum, it works perfectly ! both setups are identical in php and phpbb versions etc,
i've checked all other permissions i can think of, but nothing seems to change regarding rotating the image,
i've tried the latest version of the extension, deleting it and reinstalling it, still no change,
i'm obviously missing something somewhere, but what ?
User avatar
axe70
Registered User
Posts: 751
Joined: Sun Nov 17, 2002 10:55 am
Location: Italy
Name: Alessio

Re: [3.2][3.3][RC] Attachments images rotation extension - dev/bugs logs

Post by axe70 »

on file
/ext/w3all/imageattachrotation/core/fileRotate.php
where there three of these:

Code: Select all

echo 'W3ERROR_NO PERMISSION'; exit;
you could comment out starting from the first you found changing into:

Code: Select all

//echo 'W3ERROR_NO PERMISSION'; exit;
and try: you'll see what piece of code is giving the problem, and if commenting out/removing it, after, you'll get then some error more

anyway, standing on code flow, that should be rewritten to be improved, you should get this only if:
if the attachment is not visible, orphan, or you not own or you have no rights over the attachment, or the image format is not allowed (jpg, gif and png) as possible, also in phpBB
Do not take me too serious
Anyway i do not like Discourse
foxiedog
Registered User
Posts: 13
Joined: Fri Jul 31, 2020 10:26 am

Re: [3.2][3.3][RC] Attachments images rotation extension - dev/bugs logs

Post by foxiedog »

thanks :)
that did the trick :)
working ok now, and no other errors as far as i can see as yet:)
it seems odd that it works ok on the live forum without those lines being commented out, but not on the test forum,
bug-i
Registered User
Posts: 166
Joined: Fri Feb 17, 2017 12:45 pm

Re: [3.2][3.3][RC] Attachments images rotation extension - dev/bugs logs

Post by bug-i »

Any chance to make this extension compatible with Quoted Image as Thumbnail?

If I rotate the image in the original post, than this is not reflected in quoted posts. Dont know if this is related to this extension here, or to the quoting extension.
User avatar
HiFiKabin
Community Team Member
Community Team Member
Posts: 6774
Joined: Wed May 14, 2014 9:10 am
Location: Swearing at the PC, UK
Name: James

Re: [3.2][3.3][RC] Attachments images rotation extension - dev/bugs logs

Post by HiFiKabin »

Replied to HERE
bug-i
Registered User
Posts: 166
Joined: Fri Feb 17, 2017 12:45 pm

Re: [3.2][3.3][RC] Attachments images rotation extension - dev/bugs logs

Post by bug-i »

Thanks - I obviously posted the wrong extension. I am indeed using 3Di Quote Attachments Img in Posts, not the one from hifikabin.
https://www.phpbb.com/customise/db/exte ... pic/238521

I guess this can only be solved by using and storing the rotated image in the original file(name), but not sure about that. Maybe 3Di has a suggestion how to solve this.
scheccia
Registered User
Posts: 94
Joined: Fri Feb 10, 2017 8:16 am

Re: [3.2][3.3][RC] Attachments images rotation extension - dev/bugs logs

Post by scheccia »

it's possible enable it on webp image?
User avatar
axe70
Registered User
Posts: 751
Joined: Sun Nov 17, 2002 10:55 am
Location: Italy
Name: Alessio

Re: [3.2][3.3][RC] Attachments images rotation extension - dev/bugs logs

Post by axe70 »

Is still the extension fully working fine on 3.3.10?
Awesome! Nice to know.
But it deserve a deep improvement because many parts can be now shortened and be less complicate.
I will do these days.

Absolutely yes but it is necessary to add
https://www.php.net/manual/en/function.imagewebp.php
to correctly process and store webp files
/ext/w3all/imageattachrotation/core/fileRotate.php
and to add the related webp type of img into the overall_footer js code
/ext/w3all/imageattachrotation/styles/prosilver/template/event/overall_footer_body_after.html
into this line

Code: Select all

var imgARY = ["jpg", "jpeg", "gif", "png"];
Coming asap!
Do not take me too serious
Anyway i do not like Discourse
scheccia
Registered User
Posts: 94
Joined: Fri Feb 10, 2017 8:16 am

Re: [3.2][3.3][RC] Attachments images rotation extension - dev/bugs logs

Post by scheccia »

i'm on 3.3.8
i edit your file and work (I made a mistake).
edit

Code: Select all

 $validImgExt = array("jpg", "jpeg", "gif", "png")
in

Code: Select all

$validImgExt = array("jpg", "jpeg", "gif", "png", "webp");
after

Code: Select all

elseif(strtolower($attachment['extension']) == 'png'){
	 $source = @imagecreatefrompng($filesFolderPhysicalName);
	}
add

Code: Select all

elseif(strtolower($attachment['extension']) == 'webp'){
	 $source = @imagecreatefromwebp($filesFolderPhysicalName);
	}
after

Code: Select all

$source = @imagecreatefromjpeg($filesFolderThumbPhysicalName); 
	   if($source){
       $rotate = imagerotate($source, $degrees, 0);
      if($rotate){
       imagejpeg($rotate, $filesFolderThumbPhysicalName);
      }
     } 
      
	 }
add

Code: Select all

elseif( strtolower($attachment['extension']) == 'webp'){
   	$rotate = imagerotate($source, $degrees, 0);
	  $saved = imagewebp($rotate, $filesFolderPhysicalName);
	  // thumb
     $source = @imagecreatefromwebp($filesFolderThumbPhysicalName); 
	   if($source){
       $rotate = imagerotate($source, $degrees, 0);
      if($rotate){
       imagewebp($rotate, $filesFolderThumbPhysicalName);
      }
     }
      
	 }
Last edited by Mick on Fri Oct 13, 2023 11:33 am, edited 1 time in total.
Reason: Removed unnecessary full quotes.
User avatar
axe70
Registered User
Posts: 751
Joined: Sun Nov 17, 2002 10:55 am
Location: Italy
Name: Alessio

Re: [3.2][3.3][RC] Attachments images rotation extension - dev/bugs logs

Post by axe70 »

I just re-opened the code after time and it look like a nightmare that still work :D

I will try to improve it a little, of course adding the code you just added, into the next 1.0.5.

I just tested it into last phpBB and firefox. When i click into the rotate icon nothing appears.
The rotation popup do not show. The returned h position value seem to be the problem. I am sure that there are more bugs around to be fixed, so let's take a look and maybe also add something whenever an idea come out.
If any suggestion/help let know!
Cheers!
Do not take me too serious
Anyway i do not like Discourse
User avatar
axe70
Registered User
Posts: 751
Joined: Sun Nov 17, 2002 10:55 am
Location: Italy
Name: Alessio

Re: [3.2][3.3][RC] Attachments images rotation extension - dev/bugs logs

Post by axe70 »

I just reviewed the code this morning.
It is still fully working everywhere except the fact that as said, my tests leads firefox to display nothing at all when the rotate icon is clicked, due to a wrong calculated y position.

It has been fixed to display ok into any browser/viewport. Even when phpBB display iframed into some external page.
The version 1.0.5 is coming within today.
Do not take me too serious
Anyway i do not like Discourse
User avatar
axe70
Registered User
Posts: 751
Joined: Sun Nov 17, 2002 10:55 am
Location: Italy
Name: Alessio

Re: [3.2][3.3][RC] Attachments images rotation extension - dev/bugs logs

Post by axe70 »

17 Oct 2023

Version 1.0.5 has been released.
Fix the rotation popup to correctly show up on browsers/devices.
Add webp img format
https://github.com/axew3/phpBB-image-at ... /tag/1.0.5

https://github.com/axew3/phpBB-image-at ... s-rotation

Yes, many things could have been improved and shorted and added and...
It will be done! 1.0.6 may will be moved to the next level!

Any suggestion?
Cheers!
Do not take me too serious
Anyway i do not like Discourse

Return to “Extensions in Development”