News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Automatic Attachment Rotation (and Resize)

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

Previous topic - Next topic

Sir Osis of Liver

Same here, GD works in 7.4, not in 8.0.  Imagick works in both.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

GL700Wing

#461
Quote from: Sir Osis of Liver on May 08, 2023, 12:57:08 PMSame here, GD works in 7.4, not in 8.0.  Imagick works in both.

If you make the following code change in ./Sources/Subs-AutoRotation.php the mod will work with GD for PHP 8.0 (and it will still work for earlier releases of PHP).

Find:
    if ($success && is_resource($dst_img))Replace With:
    if ($success)
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

Sir Osis of Liver

Works in GD and Imagick in php 8.0.  Nice.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

woolly bugger

I'm getting errors when trying to install on 2.1.4

Quote./Themes/default/Post.template.php TEST FAILES


m4z

The mod doesn't claim compatibility with 2.1.3 (probably an oversight) or 2.1.4 (maybe there isn't a compatible version released yet).

What are the details of the failed test? Do you have other mods installed?
"Faith is what you have in things that don't exist."
--Homer Simpson

Es gibt hier im Forum ein deutsches Support-Board!

@rjen

The mod meds to be updated for 2.1.4. Author is working on it
Running SMF 2.1 with latest TinyPortal at www.fjr-club.nl

GL700Wing

Version 6.20 - July 01, 2023
o Added option to only allow specific image MIME types (including error message support for the SMF 2.0 Improved Attachment Error Handling mod). This feature is only available for SMF 2.0.16 and later and for all SMF 2.1.1 and later.
  - If a newly attached image has a MIME type that is not supported by the forum image software (ie, GD or iMagick) an error message will be logged in the forum log with the details of the attachment name, the username, the image MIME type and forum image software.
o If the mod setting Automatically process existing images using the settings above when messages are displayed is enabled and an existing image has a MIME type that is not supported by the forum image software (ie, GD or iMagick) an error message can optionally be logged in the forum log with the details of the attachment name, the forum message it is attached to, the image MIME type and forum image software.
o Added support for some of the additional image MIME types supported by iMagick (eg, 'tiff').
o Fixed issue that generated an error message in the forum log if an attempt was made to upload an image with an allowed filename extension (eg, 'jpg') that was actually an unsupported image MIME type (eg, 'svg').
o Fixed issue that caused a memory allocation error message to be logged if the value of the PHP memory_limit is 1Gb or more.
o Fixed issue that prevented images quoted being displayed when the Post and PM Inline Attachments mod was also installed.
o Fixed issue that occurred sometimes when the Image Attachment Thumbnail View mod is installed and the 'Allow members to see a thumbnail-sized view of image attachments in member profiles' setting is enabled.
o Fixed issue that prevented avatars from being displayed in the Admin Centre when the 'Display images (and thumbnails if they exist) in the Admin Center' setting was enabled.
o Fixed PHP 8.0 bug reported by Sir Osis of Liver that generated "Path cannot be empty" error messages for uploaded avatars that are saved into the default attachments directory in JPG format if the mod setting Automatically process existing images using the settings above when messages are displayed (was previously 'Resize, compress and/or reformat existing images when messages are displayed') is enabled (same issue with PHP 7.4 but different error messages - additional information here).
o Fixed PHP 8.0 bug reported by Sir Osis of Liver that resulted in images not being resized.
o Fixed issue in core code for SMF 2.0.16/2.1.0 and later that prevents thumbnails being created for BMP images - fix only applies if this mod is enabled.
o Fixed issue in core code that resulted in an empty thumbnail file being created if a thumbnail could not be created - only applies if this mod is enabled. (See SMF 2.0.17 - Thumbnail file with 0/zero size created).
o Updated code to only remove EXIF data from newly attached JPEG images - previous versions also did this for existing images when a message was displayed if the mod setting Automatically process existing images using the settings above when messages are displayed (was previously 'Resize, compress and/or reformat existing images when messages are displayed') was enabled but because there was no way of knowing if the EXIF data had already been removed this resulted in unnecessary processing of each JPEG image every time it was displayed.
o Updated code for manual/batch resizing of images via the Administration Center as follows:
  - Images will now be rotated and/or reformatted if those settings are enabled in the mod settings (rotation only possible for JPEG images that contain orientation data).
  - Images uploaded by a member of a Primary Membergroup, Additional Membergroup, or Post Count Based Group that can choose different options will not be resized or have their JPEG quality changed.
  - Additional code updates for batch resizing via File Maintenance as follows:
    ! Link to 'readme' file with information about the recommended forum settings for this process (opens in new tab).
    ! Warning message if Maintenance Mode is not enabled.
    ! Note showing how many images need to be processed and possible time required in minutes (based on 30 images per minute).
    ! Option to delete the backup directory/folder and database table created for and used by the batch resizing process (the backup directory/folder is also used for manual processing if the setting to keep a backup of original image file is enabled).
    ! Confirmation now required for batch starting processing (and also required for deleting the backup directory/folder and database table).
o Confirmation now required for resetting the orientation flag (done via File Maintenance).
o For SMF 2.1: If automatic rotation is disabled a message will be displayed in the attachment upload area advising that even though JPEG images may be rotated when they are uploaded they will not be rotated when the message is saved.
o Removed integration support for Post and PM Inline Attachments mod versions prior to v6.18.
o Added support for SMF 2.1.3 and 2.1.4.
o Removed support for releases of SMF 2.0 prior to SMF 2.0.14 and for SMF 2.1.0.
o SMF 2.0 and SMF 2.1: Language files are now installed in mod specific directory/folder.
o SMF 2.0.14-2.0.19 and SMF 2.1.1: Mod upgrade option available for v6.13, v6.14, v6.15 and v6.16.
o SMF SMF 2.1.2-2.1.3: Mod upgrade option available for v6.15 and v6.16.


Enjoy!!
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

First of all, a huge thank you for your extensive adaptation. Now to my question...
The procedure would then be as follows?
- Uninstall Automatic Attachment Rotation
- Update forum software from 2.1.3 to 2.1.4
- Install new version of Automatic Attachment Rotation
...is this the correct procedure?

GL700Wing

Quote from: Volker S on July 01, 2023, 06:41:23 AMFirst of all, a huge thank you for your extensive adaptation. Now to my question...
The procedure would then be as follows?
- Uninstall Automatic Attachment Rotation
- Update forum software from 2.1.3 to 2.1.4
- Install new version of Automatic Attachment Rotation
...is this the correct procedure?
Yes - you must uninstall any previous version of this mod before you attempt to upgrade to 2.1.4.
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

I can't import a jpg-Picture with your new Addon hier in the Forum (in my Forum i can). Because that, i use a Link.



In the German translation, the text leads to some confusion because there is no button. It would be better if it said the following:
"Drag your files here, or click on this line to add files."
Where can I change this - I didn't find it in the language files?


m4z

Quote from: Volker S on July 01, 2023, 12:50:39 PMIn the German translation, the text leads to some confusion because there is no button. It would be better if it said the following:
"Drag your files here, or click on this line to add files."
Where can I change this - I didn't find it in the language files?

That has already been changed in the translation a month ago (it now reads "Klicken Sie hier oder ziehen Sie Dateien hierher[...]"), but apparently this forum still uses older language files. I have requested to have them updated.

You can update them on your own forum by re-adding the language. It will show the files that have been updated and you can overwrite them, losing local changes.

If you're maintaining your own translation, and don't want to lose your local changes, it's the string $txt['attach_drop_zone'] in Post.${your_language}.php.
"Faith is what you have in things that don't exist."
--Homer Simpson

Es gibt hier im Forum ein deutsches Support-Board!

GL700Wing

Quote from: Volker S on July 01, 2023, 12:50:39 PMI can't import a jpg-Picture with your new Addon hier in the Forum (in my Forum i can). Because that, i use a Link.



In the German translation, the text leads to some confusion because there is no button. It would be better if it said the following:
"Drag your files here, or click on this line to add files."
Where can I change this - I didn't find it in the language files?
This issue is not related to this mod but is a known issue with the German language pack - see Incorrect representation in SMF 2.1.4.
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 6.21 - July 02, 2023
o Bug fix for issue that occasionally caused error messages to be generated for non-image attachments.


Note: There is an upgrade option for v6.20.
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

m4z

Quote from: GL700Wing on July 01, 2023, 05:57:32 PMThis issue is not related to this mod but is a known issue with the German language pack - see Incorrect representation in SMF 2.1.4.

Ah, my bad. I thought that was fixed already, but apparently the language files here weren't updated after the fix landed in there. Should have poked the admins but didn't.

And because I thought that was fixed, I didn't see the connection.
[/OT]
"Faith is what you have in things that don't exist."
--Homer Simpson

Es gibt hier im Forum ein deutsches Support-Board!

Volker S

#474
@GL700Wing
I was just about to update your update and resize tool to the new version 6.21.
You cannot view this attachment.

Here is the result:
"You cannot download or install new packages because the Packages directory, or one of the files in it, is not writable! "
You cannot view this attachment.

Here is my Packages-Directorry (drwxr-xr-x / 755):
You cannot view this attachment.

Volker S

Last entry of mine can be deleted - the reason is not your mod - so I better ask in the general forum

@rjen

Just installed latest version (6.21) on SMF 2.1.4.

It works fine, but for some reason it is not picking up the Dutch language strings. Files are in the correct folder, but the descriptions will only show in English?
Running SMF 2.1 with latest TinyPortal at www.fjr-club.nl

GL700Wing

Quote from: @rjen on July 03, 2023, 03:57:48 PMJust installed latest version (6.21) on SMF 2.1.4.

It works fine, but for some reason it is not picking up the Dutch language strings. Files are in the correct folder, but the descriptions will only show in English?
Is that for all descriptions or only some - reason I'm asking is that some new/modified strings are only in English.
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

@rjen

All descriptions are in English, it seems the alternate language files are not picked up at all
Running SMF 2.1 with latest TinyPortal at www.fjr-club.nl

GL700Wing

Quote from: @rjen on July 04, 2023, 01:43:01 AMAll descriptions are in English, it seems the alternate language files are not picked up at all
Ok - if you copy the Dutch language file to the '-utf8' variant (eg, copy name.dutch.php to name.dutch-utf8.php) does that fix the problem?
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

Advertisement: