Automatic Attachment Rotation (and Resize)

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

Previous topic - Next topic

petewadey

I checked my Admin log and I definitely installed SMF 2.0.18 before this mod. I have now replaced my code with the one you posted and all seems well. Many thanks

@rjen

After installing the new version on 2.0.18 I am missing the Rotate/Flip option when editing posts...

See attachments...
Works in 5.11
Option gone in 6.00
Running SMF 2.1 with latest TinyPortal at www.fjr-club.nl

GL700Wing

Uploaded v6.01 - February 05, 2021
o Reinstated support for co-installation with versions of the Post and PM Inline Attachments mod prior to v7.00 - support was accidentally left out in v6.00 of this mod.  Reported by @rjen.




NOTE: This mod has been designed to work with the Post and PM Inline Attachments mod and although it doesn't matter in which order these mods are installed they must be uninstalled in the reverse order if you need to uninstall/reinstall this mod.  Failure to follow this procedure will result in an incomplete uninstall for both mods.
Life doesn't have to be perfect to be wonderful ...

@rjen

Running SMF 2.1 with latest TinyPortal at www.fjr-club.nl

@rjen

Quote from: GL700Wing on February 04, 2021, 08:53:41 AM
Uploaded v6.01 - February 05, 2021
o Reinstated support for co-installation with versions of the Post and PM Inline Attachments mod prior to v7.00 - support was accidentally left out in v6.00 of this mod.  Reported by @rjen.

I just installed v6.01 of the mod after Post and PM Inline Attachments v7.00, and there is no change: I still cannot rotate existing attachments...
Running SMF 2.1 with latest TinyPortal at www.fjr-club.nl

GL700Wing

Quote from: @rjen on February 04, 2021, 08:55:13 AM
Ouch... thanks....
Yeah - sorry.

It's becoming increasingly challenging to keep these two mods in step with each other to the point that I'm seriously considering merging them into one mod but in such a way that each feature set (ie, Auto Rotate and Inline Attachments) can be enabled/disabled independently.

Quote from: @rjen on February 04, 2021, 01:59:03 PM
I just installed v6.01 of the mod after Post and PM Inline Attachments v7.00, and there is no change: I still cannot rotate existing attachments...
If you let me know which version of SMF you're using and upload your Post.template.php file I'll fix it for you.
Life doesn't have to be perfect to be wonderful ...

GL700Wing

Quote from: GL700Wing on February 04, 2021, 10:34:24 PM
It's becoming increasingly challenging to keep these two mods in step with each other to the point that I'm seriously considering merging them into one mod but in such a way that each feature set (ie, Auto Rotate and Inline Attachments) can be enabled/disabled independently.
Hmph - I've already given up on that idea - with the amount of 'read me' information for each mod it will become too difficult to manage.

I think the approach I'm going to take is to reload v5.11 and then make v6.xx only compatible with v7.xx of the Post and PM Inline Attachments mod (and vice versa) because the installer for each mod is trying to maintain compatibility with reciprocal versions of the other mod that are up to three years old.

Also, one of the challenges I'm trying to deal with with these mods is that they each make changes to the same area of the Post.template.php file and I'd started 'ignoring' errors during installation in order to support multiple older versions of each mod plus the situation where the other mod is not installed.

So - I'm going to completely review the installation process for each of these mods for when they are installed together with the view to eliminating the need to use 'ignore' statements for installation errors in Post.template.php.  However, and even if this is possible, it may become necessary to install these mods in a specific order (and to uninstall them in the reverse order if the mod that was installed first needs to be uninstalled).

I've got a fair bit of work already lined up for next week so it might be a couple of weeks before I can get this worked out for both mods.
Life doesn't have to be perfect to be wonderful ...

@rjen

Quote from: GL700Wing on February 04, 2021, 10:34:24 PM
Quote from: @rjen on February 04, 2021, 01:59:03 PM
I just installed v6.01 of the mod after Post and PM Inline Attachments v7.00, and there is no change: I still cannot rotate existing attachments...
If you let me know which version of SMF you're using and upload your Post.template.php file I'll fix it for you.

I am on 2.0.18, but I have already made the previous MOD versions 2.0.18 compliant, so I am OK: I will stay on the old versions while you sort out the mods...

Just for your information I am adding the file here, perhaps it will help in you efforts...
It seems that the code from line 515 is missing...
Running SMF 2.1 with latest TinyPortal at www.fjr-club.nl

@rjen

Find attached the dutch language files updated to the latest version
Running SMF 2.1 with latest TinyPortal at www.fjr-club.nl

GL700Wing

Uploaded v6.02 - February 06, 2021
o Fixed bug that prevented this mod from fully installing with Post and PM Inline Attachments v7.00 - as reported by @rjen.



IMPORTANT NOTE: In order to fully support the Post and PM Inline Attachments mod you must install this mod after you install that mod!!
Also, if you subsequently need to uninstall the Post and PM Inline Attachments mod you must uninstall this mod beforehand.



Many thanks to @rjen for the Dutch language files.
Life doesn't have to be perfect to be wonderful ...

Rob Lightbody

Hi,

I uninstalled 5.9, which had been working fine.

Installed the 2.0.18 update for SMF (coming from 2.0.17).

And then installed 6.02 version of this mod.

Attaching images now just comes up with a blank screen, and doesn't work.  Turning the mod off in attachment settings fixes the problem.

No error in the error log.

Thanks.

GL700Wing

Quote from: Rob Lightbody on February 15, 2021, 01:38:29 PM
Attaching images now just comes up with a blank screen, and doesn't work.  Turning the mod off in attachment settings fixes the problem.
I've installed v6.02 of mod on a new SMF 2.0.18 forum and also on an SMF 2.0.18 forum that has more than 130 other mods installed I can successfully attach images on both forums.

A blank/white screen can be an indication of insufficient PHP memory for image processing - you can configure the amount of memory this mod can use via the 'The amount of server memory (in megabytes) to allocate to image rotation/resizing. (eg, 128)' option in 'Administration Center > Attachments and Avatars > Attachment Settings'.

Here's the details of an image I attached with this mod:
Image Dimensions: 7680 x 5760
File Size: 6.86Mb

Due to its dimensions the forum needed approximately 256Mb of memory (including the memory the forum was using) in order for auto-rotation and auto-resizing to work (for testing purposes I had no limit for attachment size).

Quote
No error in the error log.
Have you also checked the error_log file in the forum's home directory/folder?
Life doesn't have to be perfect to be wonderful ...

Rob Lightbody

Thanks for that.

It seems to go pretty immediately to the white page, no matter whether its a small or larger image.  It was set at 128, but I then tried it at various numbers up to 2048 but none worked.

I checked the other error log, and there's nothing relevant in it for the time when I was trying this.

GL700Wing

Quote from: Rob Lightbody on February 16, 2021, 05:08:47 AM
Thanks for that.

It seems to go pretty immediately to the white page, no matter whether its a small or larger image.  It was set at 128, but I then tried it at various numbers up to 2048 but none worked.

I checked the other error log, and there's nothing relevant in it for the time when I was trying this.
PM sent ...
Life doesn't have to be perfect to be wonderful ...

Rob Lightbody

Quote from: GL700Wing on February 16, 2021, 05:56:40 AM
Quote from: Rob Lightbody on February 16, 2021, 05:08:47 AM
Thanks for that.

It seems to go pretty immediately to the white page, no matter whether its a small or larger image.  It was set at 128, but I then tried it at various numbers up to 2048 but none worked.

I checked the other error log, and there's nothing relevant in it for the time when I was trying this.
PM sent ...

Thank you for your help with this offline, greatly appreciated.

What it appears to have come down to is that by upgrading my PHP level from 5.6.40 to 7.2.34, the modification started working perfectly again.


GL700Wing

Quote from: Rob Lightbody on February 20, 2021, 05:28:58 AM
Thank you for your help with this offline, greatly appreciated.

What it appears to have come down to is that by upgrading my PHP level from 5.6.40 to 7.2.34, the modification started working perfectly again.
That's great news - thanks for letting me know!
Life doesn't have to be perfect to be wonderful ...

Rob Lightbody

Hello, me again.

If I go to Admin > Attachments & Avatars > Browse Files > Resize Existing Images.

Then i click a big file that was uploaded a while ago and click the resize button I'm getting this error :-

Too few arguments to function AutoRotation_Aspect(), 2 passed in /home/theqesto/public_html/forum/Sources/Subs-ResizeExistingImages.php on line 417 and exactly 4 expected


The mod is otherwise operating perfectly.

GL700Wing

Quote from: Rob Lightbody on March 04, 2021, 05:41:45 AM
Hello, me again.

If I go to Admin > Attachments & Avatars > Browse Files > Resize Existing Images.

Then i click a big file that was uploaded a while ago and click the resize button I'm getting this error :-

Too few arguments to function AutoRotation_Aspect(), 2 passed in /home/theqesto/public_html/forum/Sources/Subs-ResizeExistingImages.php on line 417 and exactly 4 expected


The mod is otherwise operating perfectly.
Thanks for letting me know about this bug - I've worked out the fix and I'll upload a new version of the mod shortly.

In the meantime, you can apply the following fix to line 592 of ./Sources/Subs-AutoRotation.php (it won't affect the ability of the mod to be uninstalled as this file is removed completely):

Find:
function AutoRotation_Aspect(&$width, &$height, $prefix, $otherSettings)
Replace With:
function AutoRotation_Aspect(&$width, &$height, $prefix = '', $otherSettings = '')
Life doesn't have to be perfect to be wonderful ...

Rob Lightbody


Denny O

I am able to load a 4474.64 kB, 4032x1960 jpeg pic and smaller but unable to load a larger one.
Our site is
SMF 2.0.15 | SMF © 2017, Simple Machines  XHTML RSS WAP2
The mod is
Automatic Attachment Rotation (and Resize)   ver5.8

I can't seem to find a size limit, is there one and if not why might this be a problem?
Hook'in Walleyes while Watch'in my Hawkeyes!

Advertisement: