Advertisement:

Author Topic: Resize Attached Images (Updated for 2.0 RC4)  (Read 56197 times)

Offline ModelBoatMayhem

  • Jr. Member
  • **
  • Posts: 197
    • Model Boat Mayhem
Re: Resize Attached Images (Updated for 2.0 RC4)
« Reply #240 on: November 27, 2013, 06:48:11 AM »

Looking to install this mod but can I verify a couple of things first please:


1. Will it resize all new attachments to sizes set in Admin/Attachment Settings
      or Mod CP, which takes priority?

2. Will it allow any size photo upload even if Admin/Attachment Settings are set to say 200K?

3. I have over 6.4Gig of attachments. Will this mod go through and resize all of those?!


Thanks is advance,
 Martin

NB: where can I find info on multiple Attachment directories?

That's my firm opinion.... but what do I know?!

Offline Hristo

  • Jr. Member
  • **
  • Posts: 248
  • Gender: Male
  • SMF 2.0.6
Re: Resize Attached Images (Updated for 2.0 RC4)
« Reply #241 on: November 27, 2013, 09:42:48 AM »
Why not install it on a test forum or even better a clone of your forum and test it how it works.

As for multiple Attachment directories, use this mod (it works just fine despite the warning):
http://custom.simplemachines.org/mods/index.php?mod=2851

Offline ModelBoatMayhem

  • Jr. Member
  • **
  • Posts: 197
    • Model Boat Mayhem
Re: Resize Attached Images (Updated for 2.0 RC4)
« Reply #242 on: November 27, 2013, 10:12:44 AM »

Some of these Mods work in a test environment but have given me problems when under 'load'!


Coping 8.4 Gigs to a test forum is going to be quite laborious !

That's my firm opinion.... but what do I know?!

Offline Hristo

  • Jr. Member
  • **
  • Posts: 248
  • Gender: Male
  • SMF 2.0.6
Re: Resize Attached Images (Updated for 2.0 RC4)
« Reply #243 on: November 27, 2013, 01:23:11 PM »
1. There is no such option (to set image dimensions limit) before the mod is installed so I'm not sure I understand the question.

2. If after resize the image is over the set limit (like 200k) it will not allow it to be attached

3. Yes, it can resize the pre-mod images. When "Resize existing images" is checked the bigger than the set size images get resized on the first load of the forum page on which they are shown. I suppose the goal of that is to spread in time the server load.

Still at least you have to backup before that. And since you have the backup...  Well, it's up to you.

Also you may consider using and another mod - Smush it:
https://github.com/Spuds?tab=repositories

http://www.simplemachines.org/community/index.php?topic=433547.0

Offline ModelBoatMayhem

  • Jr. Member
  • **
  • Posts: 197
    • Model Boat Mayhem
Re: Resize Attached Images (Updated for 2.0 RC4)
« Reply #244 on: November 27, 2013, 04:04:17 PM »
Re: 1

http://www.simplemachines.org/community/index.php?topic=342947.msg2314619#msg2314619

Quote
V2.0
 Features added in the Attachment settings in the Admin CP.
 - The ability to set a max width and height for attached images separately rather than using the values for posted images


SMF-S m u s h i t    looks interesting!
https://github.com/Spuds?tab=repositories
That's my firm opinion.... but what do I know?!

Offline Hristo

  • Jr. Member
  • **
  • Posts: 248
  • Gender: Male
  • SMF 2.0.6
Re: Resize Attached Images (Updated for 2.0 RC4)
« Reply #245 on: November 27, 2013, 07:00:56 PM »
Ah, you mean the attributes for the <img> tag (which no one should use at all). I suppose the pre 2.0's mod versions has used the options found in Layout's settings to get the values. It says clearly that they are independent of them.

Offline lc62003

  • Jr. Member
  • **
  • Posts: 140
Re: Resize Attached Images (Updated for 2.0 RC4)
« Reply #246 on: December 05, 2013, 01:06:15 PM »
Any news?   ;)

Offline Kays

  • Customizer
  • SMF Hero
  • *
  • Posts: 8,948
  • Gender: Male
    • Kayssplace
Re: Resize Attached Images (Updated for 2.0 RC4)
« Reply #247 on: December 07, 2013, 09:33:34 AM »
Finally did get a chance to check it with a forum that has the old style encryption and the mod seems to work as it should with data similar to what you had posted.

So I guess that the next thing would be to verify the attachment directories and their ids. In the database settings table, look for the variable "attachmentUploadDir" and post the value. It's a serialised array so it might be a bit difficult for you to decipher.

@ModelBoatMayhem, did your questions get answered?

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

Offline lc62003

  • Jr. Member
  • **
  • Posts: 140
Re: Resize Attached Images (Updated for 2.0 RC4)
« Reply #248 on: December 08, 2013, 03:23:52 PM »
Cool.  It is:


a:2:{i:1;s:42:"/home/site/public_html/bbs/attachments2";i:3;s:41:"/home/site/public_html/bbs/attachments";}

Offline Kays

  • Customizer
  • SMF Hero
  • *
  • Posts: 8,948
  • Gender: Male
    • Kayssplace
Re: Resize Attached Images (Updated for 2.0 RC4)
« Reply #249 on: December 09, 2013, 01:11:17 PM »
OK, according to that, the folder with id 1, is the attachments2 folder and the folder named attachments has the id of 3. Which is odd since normally id 1 is the original attachments folder. Unless it was named attachments2 to start with. ???

That image which is giving you the problem, which folder is it in? attachments or attachments2?

Files with the old style encryption for the file name, are they only in one folder or in both?

Do you see any files with just the file name in either folder. These would be the first attachments uploaded going way back. If so, in which folder? Which folder is it in according to the database (1 or 3)? Also, can you view these in the attachments listing in the admin cp?

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

Offline lc62003

  • Jr. Member
  • **
  • Posts: 140
Re: Resize Attached Images (Updated for 2.0 RC4)
« Reply #250 on: December 09, 2013, 03:59:34 PM »
Strange indeed.  Story of my life.   ;D

The example file is in attachments.

They appear to be in both.  Here is a sample file from attachments2:

181011_9fb76b92ef5f6a7619ba8009b765fcbac3a     Or is this different?  The original file name does not appear to be present here.   ???

No, they are all that configuration. 

Yes, I see the example pic listed in the CP.  If I click the link there same result....404. 

Offline lc62003

  • Jr. Member
  • **
  • Posts: 140
Re: Resize Attached Images (Updated for 2.0 RC4)
« Reply #251 on: December 23, 2013, 03:03:35 PM »
I realize you are a volunteer so sorry to push a bit.  Sure would be nice to solve this issue.  My forum is tech heavy, meaning it relies on pix.  Now many are missing.  Heck, I begged for this functionality to be included in future SMF versions.   ;)

Offline Kays

  • Customizer
  • SMF Hero
  • *
  • Posts: 8,948
  • Gender: Male
    • Kayssplace
Re: Resize Attached Images (Updated for 2.0 RC4)
« Reply #252 on: December 24, 2013, 05:38:31 PM »
181011_9fb76b92ef5f6a7619ba8009b765fcbac3a is the format currently used for naming attachments. Which is the file id followed by the file_hash. If there's no value for file_hash in the database. then the old format is used. Ether just the file name or as in your case the old style encryption which included the file id, file name and a hash of the file name

Getting back to this from the previous page.

Quote
Here is an example of a pic that doesn't work:   

in attachments:
117963_DSCF0958_JPG3497f7e437ffce635e7095e


Here is the corresponding database entry:

 id_attach  id_thumb  id_msg    id_member  attachment_type      filename    size    downloads  width  height  approved  fileext  mime_type  id_folder  file_hash
117963       136432  1110539    0        0                      DSCF0958.jpg    56801    421         800    600        1              jpg    image/jpeg    3   


In looking through this thread there was a problem reported when the extension on the file name was in upper case. In the example above, extension for the name on the file in the attachments2 folder is in uppercase. While the name in the database shows the extension being in lowercase. This was suppose to be fixed. But maybe not... ::)

For the above file, or one similar, try changing the name in the database so that the extension is in upper case.

Do the thumbnails show for these images?

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

Offline lc62003

  • Jr. Member
  • **
  • Posts: 140
Re: Resize Attached Images (Updated for 2.0 RC4)
« Reply #253 on: December 25, 2013, 09:38:51 PM »
Changing to upper case in the DB is a no-go.  No thumbnails either.   :(

Offline lc62003

  • Jr. Member
  • **
  • Posts: 140
Re: Resize Attached Images (Updated for 2.0 RC4)
« Reply #254 on: January 13, 2014, 02:46:52 PM »
A few days shy of 3 mos.  Thanks for your time.  I'm done with this one.

Offline Beer

  • Newbie
  • *
  • Posts: 4
Re: Resize Attached Images (Updated for 2.0 RC4)
« Reply #255 on: January 28, 2014, 06:57:12 AM »
 Good day!
 How to make resized images were 100 pix less than specified in the properties admin area?

For example:
 1000ps - the maximum image width of the admin area (httр://site.beer/forum/index.php?action=admin;area=featuresettings;sa=layout;)
 if load 1000px - not resized;
 if load 1200px - working Image Resize to 900 (httр://site.beer/forum/index.php?action=admin;area=manageattachments;sa=attachments).

 Thank you! ;)
« Last Edit: January 28, 2014, 07:08:55 AM by Beer »

Offline kungfujoe

  • Semi-Newbie
  • *
  • Posts: 21
Re: Resize Attached Images (Updated for 2.0 RC4)
« Reply #256 on: February 08, 2014, 07:23:34 PM »
It appears as if the attachment size check occurs BEFORE the resizing.

For example, on my site, I left the attachment size limit to default (I believe it's 128kB).  I then tried to upload a pic that was about 2MB in size.  After uploading, I got an error message about it being too large.

So I went back and set the attachment size limit to 0 (disabling it).  Uploaded the same photo, and after it was posted, it said the size was 61kB...which should have been small enough to let it through the first time around.

Offline melanieh75

  • Semi-Newbie
  • *
  • Posts: 42
Re: Resize Attached Images (Updated for 2.0 RC4)
« Reply #257 on: Today at 12:10:37 PM »
Running SMF 1.1.19
Applied mod "Resize Attached Images" and it works fine. But, there is one topic that is not working. After removing the mod, the topic is fine and looks normal. Install the mod again and again it breaks this one topic.

If you try to view the topic, the following error comes up:

Quote
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'S 1958 8.jpg'
    WHERE ID_ATTACH = 9670
    LIMIT 1' at line 2
    File: /home/fundubsc/public_html/SimpleMachinesForum/Sources/Display.php
    Line: 1228

    Note: It appears that your database may require an upgrade. Your forum's files are currently at version SMF 1.1.19, while your database is at version 1.1.11. The above error might possibly go away if you execute the latest version of upgrade.php.


Again, all other topics appear OK, just this one that is no longer working.