News:

Wondering if this will always be free?  See why free is better.

Main Menu

Automatic Attachment Rotation (and Resize)

Started by dougiefresh, March 04, 2016, 07:34:59 PM

Previous topic - Next topic

FrizzleFried

It appears this mod will need a small edit to be compatible with 2.1.2... I am getting a single error..


Code(Find) Select

id_thumb, attachment_type, mime_type, approved, id_msg
Code(Add After) Select
, proper_rotation

GL700Wing

Quote from: FrizzleFried on May 10, 2022, 10:35:33 AMIt appears this mod will need a small edit to be compatible with 2.1.2... I am getting a single error..
Yep - I'm already working on it!!
Life doesn't have to be perfect to be wonderful ...

Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

GL700Wing

Version v6.15 - May 11, 2022
o Added support for SMF 2.1.2


Note: No changes for SMF 2.0.x, SMF 2.1.0, or SMF 2.1.1
Life doesn't have to be perfect to be wonderful ...

Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

gevv

ElkArte is a modern, powerful community building forum software. https://www.elkarte.net/

GL700Wing

Version v6.16 - May 26, 2022
o SMF 2.1: Fixed bug reported by voom and woolly bugger that was causing a blank edit box to display when modifying a message that quoted another message.


Notes:
No changes for SMF 2.0.x
Upgrade option for v6.13, v6.14 and v6.15
Life doesn't have to be perfect to be wonderful ...

Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

WolfJ

I get this error when I try to resize an image

Too few arguments to function AutoRotation_Aspect(), 2 passed in /home/wolfj/public_html/Sources/Subs-ResizeExistingImages.php on line 417 and exactly 4 expected
Anyone know a fix?

Chewing on Cyanide


GL700Wing

Quote from: WolfJ on August 20, 2022, 05:31:37 PMI get this error when I try to resize an image

Too few arguments to function AutoRotation_Aspect(), 2 passed in /home/wolfj/public_html/Sources/Subs-ResizeExistingImages.php on line 417 and exactly 4 expected
Anyone know a fix?
@WolfJ - This issue was reported in March 2021 and was fixed in subsequent releases starting in September 2021 - I strongly recommend that you update to the latest version but if you don't want to do this you can apply a manual fix (this won't affect the ability of the mod to be subsequently uninstalled as this file is removed completely).

Life doesn't have to be perfect to be wonderful ...

Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

WolfJ

Quote from: GL700Wing on August 20, 2022, 09:24:51 PM
Quote from: WolfJ on August 20, 2022, 05:31:37 PMI get this error when I try to resize an image

Too few arguments to function AutoRotation_Aspect(), 2 passed in /home/wolfj/public_html/Sources/Subs-ResizeExistingImages.php on line 417 and exactly 4 expected
Anyone know a fix?
@WolfJ - This issue was reported in March 2021 and was fixed in subsequent releases starting in September 2021 - I strongly recommend that you update to the latest version but if you don't want to do this you can apply a manual fix (this won't affect the ability of the mod to be subsequently uninstalled as this file is removed completely).




Thanks for your response. Yeah, I was still using 6.02. Ever since they updated to SMF 2.1 I saw some mods were no longer available so I kind of started hoarding them. I applied the manual fix but then decided to update anyway to rule out any more issues.

Thank you again!  ;)

Chewing on Cyanide


cortez

Thanks for this excellent mod, any ideas for this on SMF 2.1.2 and PHP 7.4.28

Type of error
General
Error message
8: copy(): write of 8192 bytes failed with errno=14 Bad address
File
/home/autobusi/public_html/forum/Sources/Subs-AutoRotation.php
Line
603
URL of page causing the error
https://autobusi.org/forum/index.php?topic=22812.585

#0: smf_error_handler()
Called from unknown on line -1
#1: copy()
Called from /home/autobusi/public_html/forum/Sources/Subs-AutoRotation.php on line 603
#2: AutoRotation_ResizeExisting()
Called from /home/autobusi/public_html/forum/Sources/Subs-Attachments.php on line 1276
#3: loadAttachmentContext()
Called from /home/autobusi/public_html/forum/Sources/Display.php on line 1495
#4: prepareDisplayContext()
Called from /home/autobusi/public_html/forum/Themes/default/Display.template.php on line 256
#5: template_main()
Called from /home/autobusi/public_html/forum/Sources/Load.php on line 2760
#6: loadSubTemplate()
Called from /home/autobusi/public_html/forum/Sources/Subs.php on line 4155
#7: obExit()
Called from /home/autobusi/public_html/forum/index.php on line 194

GL700Wing

#389
Quote from: cortez on September 03, 2022, 08:41:44 AMThanks for this excellent mod, any ideas for this on SMF 2.1.2 and PHP 7.4.28

Type of error
General
Error message
8: copy(): write of 8192 bytes failed with errno=14 Bad address
File
/home/autobusi/public_html/forum/Sources/Subs-AutoRotation.php
Line
603
URL of page causing the error
https://autobusi.org/forum/index.php?topic=22812.585

#0: smf_error_handler()
Called from unknown on line -1
#1: copy()
Called from /home/autobusi/public_html/forum/Sources/Subs-AutoRotation.php on line 603
#2: AutoRotation_ResizeExisting()
Called from /home/autobusi/public_html/forum/Sources/Subs-Attachments.php on line 1276
#3: loadAttachmentContext()
Called from /home/autobusi/public_html/forum/Sources/Display.php on line 1495
#4: prepareDisplayContext()
Called from /home/autobusi/public_html/forum/Themes/default/Display.template.php on line 256
#5: template_main()
Called from /home/autobusi/public_html/forum/Sources/Load.php on line 2760
#6: loadSubTemplate()
Called from /home/autobusi/public_html/forum/Sources/Subs.php on line 4155
#7: obExit()
Called from /home/autobusi/public_html/forum/index.php on line 194
Would you please provide information on which version of the mod you're using and how to reproduce this error - thanks.
Life doesn't have to be perfect to be wonderful ...

Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

cortez

Mod is 6.16, regarding specific action - no idea, if you go to URL, that specific thread page is from 2018 so maybe it is trying to do something with existing images.

Similar to this, also very old thread:
Type of error
General
Error message
8: Trying to access array offset on value of type bool
File
/home/autobusi/public_html/forum/Sources/Subs-AutoRotation.php
Line
483
URL of page causing the error
https://autobusi.org/forum/index.php?topic=620.0
Backtrace information
#0: smf_error_handler()
Called from /home/autobusi/public_html/forum/Sources/Subs-AutoRotation.php on line 483
#1: AutoRotation_DisplayDownload()
Called from /home/autobusi/public_html/forum/Sources/Subs-Attachments.php on line 1272
#2: loadAttachmentContext()
Called from /home/autobusi/public_html/forum/Sources/Display.php on line 1495
#3: prepareDisplayContext()
Called from /home/autobusi/public_html/forum/Themes/default/Display.template.php on line 256
#4: template_main()
Called from /home/autobusi/public_html/forum/Sources/Load.php on line 2760
#5: loadSubTemplate()
Called from /home/autobusi/public_html/forum/Sources/Subs.php on line 4155
#6: obExit()
Called from /home/autobusi/public_html/forum/index.php on line 194

GL700Wing

Quote from: cortez on September 03, 2022, 09:41:33 AMMod is 6.16, regarding specific action - no idea, if you go to URL, that specific thread page is from 2018 so maybe it is trying to do something with existing images.
I'm wondering if the issue may have to do with missing image attachments - please run the
Administration Center >> Attachments and Avatars >> File Maintenance >> Attachment Integrity Check
to check the integrity and sizes of attachments and filenames listed in the database and, if necessary, fix any errors it encounters.
Life doesn't have to be perfect to be wonderful ...

Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

Volker S

#392
I have install the AddOn on my testforum - and nothing happend. Here comes my install-screens.

Installscreen_01
Installscreen_02

Setup of your AddOn: Link

Before upload a Image: Empty post
After upload a 1,1 MB Image: Try to upload

I have seen no Error. You can try at your own. My Testforum is: https://www.forum.jeepzone.de/index.php
Testaccount: test / test

SMF-Version: 2.1.2 PHP-Version: 7,4 and 8.0 (The result is the same)
Here my installed Mods: Link

GL700Wing

@Volker S

The image has to be uploaded before it can be resized so you need to set the values of the "Max attachment size per post" and "Max size per attachment" settings to a large enough value (eg, maybe 7Mb or 8Mb for photos taken using smartphones) to allow the image to be uploaded.

You cannot view this attachment.

Also, newly attached images will not be resized until the post/message is saved.

As per the following example using the default values for the mod an image that was 6.4Mb when it was uploaded was reduced to 123Kb when it was saved.

You cannot view this attachment.

You cannot view this attachment.

You cannot view this attachment.   
Life doesn't have to be perfect to be wonderful ...

Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

Volker S

Yes, it was clearly a misunderstanding on my part. I didn't notice that your addon worked after the upload. Thanks for your help. Nice Addon

dodos26

You can add permission to see image attachments for guests.

GL700Wing

Quote from: dodos26 on September 17, 2022, 11:55:57 AMYou can add permission to see image attachments for guests.
@dodos26 - There is already a standard permission for this (although it applies to all attachment types) and it can be applied to individual membergroups and/or boards.
Life doesn't have to be perfect to be wonderful ...

Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

dodos26

#397
Read what I am asking again --___--


That "although it applies to all attachment types" is not THAT "add permission to see image attachments for guests"

GL700Wing

Quote from: dodos26 on September 18, 2022, 06:07:51 AMRead what I am asking again --___--


That "although it applies to all attachment types" is not THAT "add permission to see image attachments for guests"
OK - fair enough but you didn't indicate that you already knew there was a permission for all attachment types.

That said, what you're asking for is outside the scope of what this mod was designed to do (ie, this mod has nothing to do with how, when or where attachments are displayed).

Finally, I don't appreciate the way you typed your previous response - I actually consider it to be quite rude and I won't be providing you with any further assistance.
Life doesn't have to be perfect to be wonderful ...

Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

dodos26

The way your mental denial is amazing. You create logical error due to illogical reading and then blame someone for your mistakes.

Advertisement: