Advertisement:

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

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,702
  • Mod King
    • XPtsp.com Community
Re: Automatic Attachment Rotation
« Reply #100 on: September 12, 2017, 10:23:40 AM »
Uploaded v3.7 - September 12th, 2017
o Resolved conflict with Post and PM Inline Attachments.  No functionality change.



@aegersz:  This update should take care of the conflict that you reported.
News: Missing GitHub repository...

My Free Simple Machines mods on XPtsp.com, Simple Machines Customization Site, and at GitHub!
Problem uninstalling mods?  Try Arantor's Sortable Packages (and Installed Time) mod!  It's super helpful!

Offline aegersz

  • Sophist Member
  • *****
  • Posts: 1,394
  • Gender: Male
  • "mods" junkie
    • dopetalk
Re: Automatic Attachment Rotation
« Reply #101 on: September 12, 2017, 10:30:09 AM »
so it does ! thanks again, dougie !
Linux CentOS VPS running SMF 2.0 with 140+ mods installed (the full h/w and s/w can be seen at http://forum.drugs-and-users.org/index.php/topic,3301)

Offline aegersz

  • Sophist Member
  • *****
  • Posts: 1,394
  • Gender: Male
  • "mods" junkie
    • dopetalk
Re: Automatic Attachment Rotation
« Reply #102 on: September 12, 2017, 12:32:30 PM »
whoops, the mod broke my forum and i had made a bunch of changes. I only suspected this because ./Sources/Display.php got modified ...

see https://www.simplemachines.org/community/index.php?topic=556162
Linux CentOS VPS running SMF 2.0 with 140+ mods installed (the full h/w and s/w can be seen at http://forum.drugs-and-users.org/index.php/topic,3301)

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,702
  • Mod King
    • XPtsp.com Community
Re: Automatic Attachment Rotation
« Reply #103 on: September 12, 2017, 11:47:09 PM »
Uploaded v3.7.1 - September 12th, 2017
o SMF 2.0: Fixed a syntax typo in Sources/Display.php
o SMF 2.1: Fixed a syntax typo in Sources/Subs-Attachments.php



@aegersz:  I swear I'll get this right....  Might not be today, but I'll get it right....  O:)
News: Missing GitHub repository...

My Free Simple Machines mods on XPtsp.com, Simple Machines Customization Site, and at GitHub!
Problem uninstalling mods?  Try Arantor's Sortable Packages (and Installed Time) mod!  It's super helpful!

Offline aegersz

  • Sophist Member
  • *****
  • Posts: 1,394
  • Gender: Male
  • "mods" junkie
    • dopetalk
Re: Automatic Attachment Rotation
« Reply #104 on: September 13, 2017, 01:26:29 AM »
the art of programming is the practise of bugging.

I totally forgot that I put this mod back on and then went away,  uninstalled another mod by making manual code changes, ugraded 2 more of your mods and forgot to enable php logging  :(

I spent hours trying to get my site to work ... this was the first time I ever put a mod on (this one) without testing first ... it's not your fault, I didn't follow protocol and your handy auto-refresh mod delete mod sent me on a tidy-up frenzy. love that guy !
Linux CentOS VPS running SMF 2.0 with 140+ mods installed (the full h/w and s/w can be seen at http://forum.drugs-and-users.org/index.php/topic,3301)

Offline aegersz

  • Sophist Member
  • *****
  • Posts: 1,394
  • Gender: Male
  • "mods" junkie
    • dopetalk
Re: Automatic Attachment Rotation
« Reply #105 on: October 04, 2017, 09:36:55 AM »
It's me again - i have been busy ensuring that i am running your latest releases but when i installed this on my test system, i got this error:

Parse error: syntax error, unexpected ';', expecting ')' in /var/www/html/Sources/Display.php on line 1665

so i suggest to replace:
Code: [Select]
'href' => $scripturl . '?action=dlattach . ';ts=' . $time . ';topic=' . $msg_topic . '.0;attach=' . $attachment['id_attach'],
with:
Code: [Select]
'href' => $scripturl . '?action=dlattach;ts=' . $time . ';topic=' . $msg_topic . '.0;attach=' . $attachment['id_attach'],
is this right or have i just missed something ? it works on my test system now but it's your code ...
Linux CentOS VPS running SMF 2.0 with 140+ mods installed (the full h/w and s/w can be seen at http://forum.drugs-and-users.org/index.php/topic,3301)

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,702
  • Mod King
    • XPtsp.com Community
Re: Automatic Attachment Rotation
« Reply #106 on: October 09, 2017, 09:03:50 AM »
Uploaded v3.8 - October 9th, 2017
o Fixed syntax error in code that builds the attachment link.



@aegersz:  Thank you for reporting the bug!  It's been fixed for this version.
News: Missing GitHub repository...

My Free Simple Machines mods on XPtsp.com, Simple Machines Customization Site, and at GitHub!
Problem uninstalling mods?  Try Arantor's Sortable Packages (and Installed Time) mod!  It's super helpful!

Offline landyvlad

  • Full Member
  • ***
  • Posts: 604
    • Michael Reed on Facebook
    • GSX1400 Owners ORG
Re: Automatic Attachment Rotation
« Reply #107 on: December 18, 2017, 07:31:17 AM »
What is the update process please?  Is it just upload and install the new one, or do I uninstall./delete the old one first?
(It'd be cool if this info was included in the description of the mod, for easy reference)

Thanks
Please do not PM, IM or Email me with questions on astrophysics or theology.  You will get better and faster responses by asking homeless people in the street. Thank you.

To paraphrase Kindred: "There are no technical solutions to social problems."

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,702
  • Mod King
    • XPtsp.com Community
Re: Automatic Attachment Rotation
« Reply #108 on: December 18, 2017, 09:15:35 AM »
What is the update process please?  Is it just upload and install the new one, or do I uninstall./delete the old one first?
(It'd be cool if this info was included in the description of the mod, for easy reference)
First, Package Manager won't allow you to install a newer version of a mod while an older version is installed.  If the package supports upgrading, Package Manager will give you the option to upgrade to the new version.  Most of my mods do not support upgrades in that fashion, mostly because some servers have issues with multiple install XML files and aren't smart enough to make it work....

The proper way to upgrade any mod that doesn't give the option through Package Manager is to uninstall the current version of the mod, then install  the new version.  Immediately deleting the old version is not mandatory at any stage of the upgrade process, although if you are happy with the new version, deletion of the old version is recommended.
News: Missing GitHub repository...

My Free Simple Machines mods on XPtsp.com, Simple Machines Customization Site, and at GitHub!
Problem uninstalling mods?  Try Arantor's Sortable Packages (and Installed Time) mod!  It's super helpful!

Offline @rjen

  • Jr. Member
  • **
  • Posts: 262
  • Gender: Male
Re: Automatic Attachment Rotation
« Reply #109 on: December 30, 2017, 06:35:39 AM »
I am getting this error when testing the MOD.

This error pops up when I rotate an attached impage when editing the post...
Is it just me?

https://test.fjr-club.nl/index.php?action=post2;start=0;msg=300786;df4bebae3674=18d5e877907afa4d5c23988966f6f164;board=26
8: A non well formed numeric value encountered
Bestand: /home/deb77453/domains/fjr-club.nl/public_html/test/Sources/Subs-AutoRotation.php
Regel: 90
Running SMF 2.0 with Tinyportal 1.5.1 at www.fjr-club.nl
Testing SMF 2.1 beta 4 with Tinyportal 1.6.0 at http://test2.fjr-club.nl/

Offline @rjen

  • Jr. Member
  • **
  • Posts: 262
  • Gender: Male
Re: Automatic Attachment Rotation
« Reply #110 on: December 30, 2017, 07:32:07 AM »
Another question: I am mainly looking at the function to rotate attachments manually from the post area.
Since I re-encode all attachments in the forum, the automatic rotation does not seem to work upon upload (is that correct?)

Then when I am in the post area the options for rotation seem a bit 'many' for my users and a bit confusing.
Question 1:
Rotation says 'Clockwise', but when I rotate 90 degrees it actually rotates counter-clockwise (!)

Question 2:
Is there a way to sort the options provided differently?

Quote
'No Change';
'Horizontal Flip';
'Rotate 180 deg Clockwise';
'Vertical Flip';
'Vertical Flip, Rotate 270 deg Clockwise';
'Rotate 270 deg Clockwise';
'Horizontal Flip, Rotate 270 deg Clockwise';
'Rotate 90 deg Clockwise';

For my users the rotate options are the most used, and actually those are throughout the list...
I want to present it like this:

Quote
'No Change';
'Rotate 90 deg Clockwise';
'Rotate 180 deg Clockwise';
'Rotate 270 deg Clockwise';
'Horizontal Flip';
'Vertical Flip';
'Horizontal Flip, Rotate 270 deg Clockwise';
'Vertical Flip, Rotate 270 deg Clockwise';
Running SMF 2.0 with Tinyportal 1.5.1 at www.fjr-club.nl
Testing SMF 2.1 beta 4 with Tinyportal 1.6.0 at http://test2.fjr-club.nl/

Offline @rjen

  • Jr. Member
  • **
  • Posts: 262
  • Gender: Male
Re: Automatic Attachment Rotation
« Reply #111 on: December 30, 2017, 08:00:06 AM »
I am getting this error when testing the MOD.

This error pops up when I rotate an attached impage when editing the post...
Is it just me?

https://test.fjr-club.nl/index.php?action=post2;start=0;msg=300786;df4bebae3674=18d5e877907afa4d5c23988966f6f164;board=26
8: A non well formed numeric value encountered
Bestand: /home/deb77453/domains/fjr-club.nl/public_html/test/Sources/Subs-AutoRotation.php
Regel: 90

I just checked the code, and I see it is in the memory limit.

Now I am using this MOD to set a memory limit. Is there a conflict perhaps?
http://custom.simplemachines.org/mods/index.php?mod=4111
Running SMF 2.0 with Tinyportal 1.5.1 at www.fjr-club.nl
Testing SMF 2.1 beta 4 with Tinyportal 1.6.0 at http://test2.fjr-club.nl/

Offline landyvlad

  • Full Member
  • ***
  • Posts: 604
    • Michael Reed on Facebook
    • GSX1400 Owners ORG
Re: Automatic Attachment Rotation
« Reply #112 on: January 17, 2018, 05:10:39 AM »
Bit of a problem.

Trying to uninstall v 3.3 to update to 3.8

The uninstall test shows the following error.

1.   Replace   ./Sources/Post.php   Test failed
2.   Replace   ./Sources/Post.php   Test successful
3.   Replace   ./Sources/Post.php   Test successful


Suggestions / help welcomed. :)
Please do not PM, IM or Email me with questions on astrophysics or theology.  You will get better and faster responses by asking homeless people in the street. Thank you.

To paraphrase Kindred: "There are no technical solutions to social problems."

Offline landyvlad

  • Full Member
  • ***
  • Posts: 604
    • Michael Reed on Facebook
    • GSX1400 Owners ORG
Re: Automatic Attachment Rotation
« Reply #113 on: January 20, 2018, 02:16:31 AM »
dougiefresh  - should I

1. Uninstall, ignoring the errors, or
2 Just install the new one over the top, or
3 Something else ?
Please do not PM, IM or Email me with questions on astrophysics or theology.  You will get better and faster responses by asking homeless people in the street. Thank you.

To paraphrase Kindred: "There are no technical solutions to social problems."

Online GL700Wing

  • Full Member
  • ***
  • Posts: 436
  • Gender: Female
Re: Automatic Attachment Rotation
« Reply #114 on: January 20, 2018, 04:31:27 AM »
I am getting this error when testing the MOD.

This error pops up when I rotate an attached impage when editing the post...
Is it just me?

https://test.fjr-club.nl/index.php?action=post2;start=0;msg=300786;df4bebae3674=18d5e877907afa4d5c23988966f6f164;board=26
8: A non well formed numeric value encountered
Bestand: /home/deb77453/domains/fjr-club.nl/public_html/test/Sources/Subs-AutoRotation.php
Regel: 90

I just checked the code, and I see it is in the memory limit.

Now I am using this MOD to set a memory limit. Is there a conflict perhaps?
http://custom.simplemachines.org/mods/index.php?mod=4111
I'm getting the same error message and I've confirmed it is a PHP 7.x issue (eg, earlier versions of PHP weren't as pedantic) and is not caused by a conflict with any other mods.

Line 89 of ./Sources/Subs-AutoRotation.php has the following code:
Code: [Select]
$memoryLimit = ini_get('memory_limit');and '$memoryLimit' is the value of memory_limit in your php.ini file (eg, 256M).

PHP 7.x doesn't like that '$memoryLimit' contains a non-numeric character (ie, the letter 'M') and that's why it's complaining when it is used in the calculation on line 90:
Code: [Select]
$memoryRequested = (int) $memoryLimit + ceil(($currentMemory - $memoryLimit * pow(1024, 2)) / pow(1024, 2));
The fix is to change line 89 of ./Sources/Subs-AutoRotation.php to use the PHP '(float)' function to remove non-numeric characters from memory_limit in php.ini when it becomes '$memoryLimit' (eg, 256 will be returned).
Code: [Select]
$memoryLimit = (float) ini_get('memory_limit');

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,702
  • Mod King
    • XPtsp.com Community
Re: Automatic Attachment Rotation
« Reply #115 on: January 21, 2018, 08:27:51 PM »
Bit of a problem.

Trying to uninstall v 3.3 to update to 3.8

The uninstall test shows the following error.

1.   Replace   ./Sources/Post.php   Test failed
2.   Replace   ./Sources/Post.php   Test successful
3.   Replace   ./Sources/Post.php   Test successful


Suggestions / help welcomed. :)
Attach your Sources/Post.php and I'll try to help you.  Don't and I simply can't....



@GL700Wing:  Will this fix work with PHP 5.x, though?  Cause I'll be happy to implement it, but I need to know if it'll cause issues for PHP 5.x.....
News: Missing GitHub repository...

My Free Simple Machines mods on XPtsp.com, Simple Machines Customization Site, and at GitHub!
Problem uninstalling mods?  Try Arantor's Sortable Packages (and Installed Time) mod!  It's super helpful!

Online GL700Wing

  • Full Member
  • ***
  • Posts: 436
  • Gender: Female
Re: Automatic Attachment Rotation
« Reply #116 on: January 22, 2018, 12:42:43 AM »
@GL700Wing:  Will this fix work with PHP 5.x, though?  Cause I'll be happy to implement it, but I need to know if it'll cause issues for PHP 5.x.....
Don't know - my main websites are PHP 7.x (and I can't set the version of PHP to be different on a per-forum basis within a website) but I do have one website where I can setup a PHP 5.x forum - will try and get time tonight to try it and let you know.

Offline landyvlad

  • Full Member
  • ***
  • Posts: 604
    • Michael Reed on Facebook
    • GSX1400 Owners ORG
Re: Automatic Attachment Rotation
« Reply #117 on: January 22, 2018, 02:12:30 AM »
dougiefresh when I'm next at a computer that will allow me to download and upload such files (e.g at home), I will do so.
Please do not PM, IM or Email me with questions on astrophysics or theology.  You will get better and faster responses by asking homeless people in the street. Thank you.

To paraphrase Kindred: "There are no technical solutions to social problems."

Offline landyvlad

  • Full Member
  • ***
  • Posts: 604
    • Michael Reed on Facebook
    • GSX1400 Owners ORG
Re: Automatic Attachment Rotation
« Reply #118 on: January 22, 2018, 06:00:32 PM »
It's OK success !@
I uninstalled it and then found the one edit that the uninstaller could not do, manually edited that out.
Installed new version.  All good !

Thanks.
Please do not PM, IM or Email me with questions on astrophysics or theology.  You will get better and faster responses by asking homeless people in the street. Thank you.

To paraphrase Kindred: "There are no technical solutions to social problems."

Online GL700Wing

  • Full Member
  • ***
  • Posts: 436
  • Gender: Female
Re: Automatic Attachment Rotation
« Reply #119 on: January 22, 2018, 08:34:05 PM »
@GL700Wing:  Will this fix work with PHP 5.x, though?  Cause I'll be happy to implement it, but I need to know if it'll cause issues for PHP 5.x.....
Don't know - my main websites are PHP 7.x (and I can't set the version of PHP to be different on a per-forum basis within a website) but I do have one website where I can setup a PHP 5.x forum - will try and get time tonight to try it and let you know.
Hmm - I typed a reply to this last night but it's not here - it was very late so might have forgotten to click the 'Post' button.

I tested the '(float)' fix with SMF 2.0.15 and PHP 5.6 and, in addition to rotating the images, it did not cause any errors to be logged (no other mods were installed on the forum I tested it on).