Advertisement:

Author Topic: Automatic Attachment Rotation (and Resize)  (Read 62464 times)

Offline petewadey

  • Jr. Member
  • **
  • Posts: 186
Re: Automatic Attachment Rotation (and Resize)
« Reply #300 on: February 04, 2021, 03:41:16 AM »
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

Online @rjen

  • Sr. Member
  • ****
  • Posts: 728
  • Gender: Male
    • FJR-club Nederland
Re: Automatic Attachment Rotation (and Resize)
« Reply #301 on: February 04, 2021, 05:09:57 AM »
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.0 with Tinyportal 2.0.1 at www.fjr-club.nl
Testing SMF 2.1 with Tinyportal 2.1.0 at test2.fjr-club.nl

Offline GL700Wing

  • Full Member
  • ***
  • Posts: 673
  • Gender: Female
Re: Automatic Attachment Rotation (and Resize)
« Reply #302 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.



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 ...

Online @rjen

  • Sr. Member
  • ****
  • Posts: 728
  • Gender: Male
    • FJR-club Nederland
Re: Automatic Attachment Rotation (and Resize)
« Reply #303 on: February 04, 2021, 08:55:13 AM »
Ouch... thanks....
Running SMF 2.0 with Tinyportal 2.0.1 at www.fjr-club.nl
Testing SMF 2.1 with Tinyportal 2.1.0 at test2.fjr-club.nl

Online @rjen

  • Sr. Member
  • ****
  • Posts: 728
  • Gender: Male
    • FJR-club Nederland
Re: Automatic Attachment Rotation (and Resize)
« Reply #304 on: February 04, 2021, 01:59:03 PM »
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.0 with Tinyportal 2.0.1 at www.fjr-club.nl
Testing SMF 2.1 with Tinyportal 2.1.0 at test2.fjr-club.nl

Offline GL700Wing

  • Full Member
  • ***
  • Posts: 673
  • Gender: Female
Re: Automatic Attachment Rotation (and Resize)
« Reply #305 on: February 04, 2021, 10:34:24 PM »
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.

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 ...

Offline GL700Wing

  • Full Member
  • ***
  • Posts: 673
  • Gender: Female
Re: Automatic Attachment Rotation (and Resize)
« Reply #306 on: February 05, 2021, 12:55:02 AM »
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 ...

Online @rjen

  • Sr. Member
  • ****
  • Posts: 728
  • Gender: Male
    • FJR-club Nederland
Re: Automatic Attachment Rotation (and Resize)
« Reply #307 on: February 05, 2021, 02:33:00 AM »
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.0 with Tinyportal 2.0.1 at www.fjr-club.nl
Testing SMF 2.1 with Tinyportal 2.1.0 at test2.fjr-club.nl

Online @rjen

  • Sr. Member
  • ****
  • Posts: 728
  • Gender: Male
    • FJR-club Nederland
Re: Automatic Attachment Rotation (and Resize)
« Reply #308 on: February 05, 2021, 03:29:52 PM »
Find attached the dutch language files updated to the latest version
Running SMF 2.0 with Tinyportal 2.0.1 at www.fjr-club.nl
Testing SMF 2.1 with Tinyportal 2.1.0 at test2.fjr-club.nl

Offline GL700Wing

  • Full Member
  • ***
  • Posts: 673
  • Gender: Female
Re: Automatic Attachment Rotation (and Resize)
« Reply #309 on: February 06, 2021, 04:21:48 AM »
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 ...

Offline Rob Lightbody

  • Charter Member
  • Jr. Member
  • *
  • Posts: 188
  • Gender: Male
  • Rob Lightbody, QE2 Story Forum administrator
    • The QE2 Story
Re: Automatic Attachment Rotation (and Resize)
« Reply #310 on: February 15, 2021, 01:38:29 PM »
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.

Offline GL700Wing

  • Full Member
  • ***
  • Posts: 673
  • Gender: Female
Re: Automatic Attachment Rotation (and Resize)
« Reply #311 on: February 15, 2021, 08:20:31 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 ...

Offline Rob Lightbody

  • Charter Member
  • Jr. Member
  • *
  • Posts: 188
  • Gender: Male
  • Rob Lightbody, QE2 Story Forum administrator
    • The QE2 Story
Re: Automatic Attachment Rotation (and Resize)
« Reply #312 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.

Offline GL700Wing

  • Full Member
  • ***
  • Posts: 673
  • Gender: Female
Re: Automatic Attachment Rotation (and Resize)
« Reply #313 on: February 16, 2021, 05:56:40 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 ...

Offline Rob Lightbody

  • Charter Member
  • Jr. Member
  • *
  • Posts: 188
  • Gender: Male
  • Rob Lightbody, QE2 Story Forum administrator
    • The QE2 Story
Re: Automatic Attachment Rotation (and Resize)
« Reply #314 on: February 20, 2021, 05:28:58 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.


Offline GL700Wing

  • Full Member
  • ***
  • Posts: 673
  • Gender: Female
Re: Automatic Attachment Rotation (and Resize)
« Reply #315 on: February 20, 2021, 05:34:47 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 ...

Offline Rob Lightbody

  • Charter Member
  • Jr. Member
  • *
  • Posts: 188
  • Gender: Male
  • Rob Lightbody, QE2 Story Forum administrator
    • The QE2 Story
Re: Automatic Attachment Rotation (and Resize)
« Reply #316 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.

Offline GL700Wing

  • Full Member
  • ***
  • Posts: 673
  • Gender: Female
Re: Automatic Attachment Rotation (and Resize)
« Reply #317 on: March 04, 2021, 06:40:34 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:
Code: [Select]
function AutoRotation_Aspect(&$width, &$height, $prefix, $otherSettings)Replace With:
Code: [Select]
function AutoRotation_Aspect(&$width, &$height, $prefix = '', $otherSettings = '')
Life doesn't have to be perfect to be wonderful ...

Offline Rob Lightbody

  • Charter Member
  • Jr. Member
  • *
  • Posts: 188
  • Gender: Male
  • Rob Lightbody, QE2 Story Forum administrator
    • The QE2 Story
Re: Automatic Attachment Rotation (and Resize)
« Reply #318 on: March 04, 2021, 11:03:20 AM »
That has worked a treat, thank you.