Attached Images Resizer, Converter & File Size Reducer

Looking for an Extension? Have an Extension request? Post your request here for help. (Note: This forum is community supported; while there is an Extensions Development Team, said team does not dedicate itself to handling requests in this forum)
Suggested Hosts
Post Reply
Gary787
Registered User
Posts: 2
Joined: Thu Jan 06, 2005 2:13 pm

Re: Attached Images Resizer, Converter & File Size Reducer

Post by Gary787 » Fri Dec 26, 2014 1:09 pm

I'm one of those forum admins who would love to have this extension. Thanks for working on it!

dtleahy
Registered User
Posts: 167
Joined: Sun Aug 24, 2008 5:47 pm

Re: Attached Images Resizer, Converter & File Size Reducer

Post by dtleahy » Fri Dec 26, 2014 1:52 pm

I just want to add another voice asking for the same (basic) functionality:

(nothing to do with images stored on other servers, like Photobucket or Imageshack)

An extension for uploading attachments that will do nothing if an image is under a specified pixel WxH, but will automatically resize (keeping aspect ratio) uploaded images larger than (either, or both) a specified maximum pixel WxH. Images to be saved as JPG with ____% (configurable percentage) JPG compression.
======================================

The bonus functionality below should not be included in a first release, unless trivial to the programmer. In fact, if this slows down development at all, I would skip it or think of it as something to maybe add later.

Bonus 1. - PNG to JPG conversion
(Assuming the new extension's code would invoke ImageMagick), if ImageMagick can also automatically change PNG to JPG and apply (a percentage) of jpg compression, that is a bonus (but most digital cameras produce JPG, not PNG, so this is probably not a big issue. )

Bonus 2. - user-supplied file name
(This would require changing a database field length)
In phpbb, if someone uploads an attached image, phpbb assigns the image a unique codename, like

198HSG37346UD5337

Problem is, the forum member has no idea what that is, so if they need to edit their post that has several uploaded, attached images, they would not (easily) know if 198HSG37346UD5337 was really the user's shark swimming.jpg or lion roaring.jpg or mouse scurrying.jpg image. If another user quoted back a post with an attachment, they also would be confused by the codename.

Even if the unique codename is a primary key in the database, this would work: I propose expanding the field width to allow a certain maximum number of (user-supplied) characters to be appended, so if the user supplied "shark swimming" with the uploaded image when prompted for a name, the (hidden, automatically supplied)

198HSG37346UD5337

would become 198HSG37346UD5337shark_swimming

(automatically replace blanks with underscores)

User avatar
BigBlockMopar
Registered User
Posts: 80
Joined: Tue Mar 08, 2005 3:15 pm

Re: Attached Images Resizer, Converter & File Size Reducer

Post by BigBlockMopar » Fri Dec 26, 2014 10:10 pm

Here's another vote for this Extension, or addition to the ReIMG extension.

I just upgraded one of my forums to 3.1 and just noticed I had 'forgotten' about I had installed the mod on my previous forums that my server resizes everyone's images before posting them in a topic.

I always like to provide my forum-users a hassle free experience when it comes to image uploading.
The majority of people these days (still) have a hard time properly resizing their images and since webforums IMO already have a hard time competing again crapsites like FB and such, it's not smart to keep the existing image upload and posting-'hurdles' in place for forum-users.
Signatures are overrated...

dtleahy
Registered User
Posts: 167
Joined: Sun Aug 24, 2008 5:47 pm

Re: Attached Images Resizer, Converter & File Size Reducer

Post by dtleahy » Mon Jan 05, 2015 7:47 am

DavidIQ wrote:I'm currently working on the JavaScript for ReIMG so once I finish I'll take a look at adding some attached image server side resizing functionality unless someone else picks this up. What would be the desired features?
Hi DavidIQ. Have you decided to take this project on? (That would be great!)

User avatar
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 16641
Joined: Thu Jan 06, 2005 1:30 pm
Location: Fishkill, NY
Name: David Colón
Contact:

Re: Attached Images Resizer, Converter & File Size Reducer

Post by DavidIQ » Mon Jan 05, 2015 5:02 pm

dtleahy wrote:
DavidIQ wrote:I'm currently working on the JavaScript for ReIMG so once I finish I'll take a look at adding some attached image server side resizing functionality unless someone else picks this up. What would be the desired features?
Hi DavidIQ. Have you decided to take this project on? (That would be great!)
Only after the current version of ReIMG, which is 3.0, is completed and released. Then some of these newer features would be considered for addition into version 3.1. Not really close to looking at that just yet though.
Apply to become a Jr. Extension Validator
My extensions | In need of phpBB services? | Was I helpful today?
No unsolicited PMs unless you're planning on asking for paid help.

dan filipi
Registered User
Posts: 82
Joined: Fri Dec 21, 2007 6:36 pm

Re: Attached Images Resizer, Converter & File Size Reducer

Post by dan filipi » Mon Jan 05, 2015 7:57 pm

Edited

dtleahy
Registered User
Posts: 167
Joined: Sun Aug 24, 2008 5:47 pm

Re: Attached Images Resizer, Converter & File Size Reducer

Post by dtleahy » Wed Jan 07, 2015 1:42 am

DavidIQ wrote:
dtleahy wrote:
DavidIQ wrote:I'm currently working on the JavaScript for ReIMG so once I finish I'll take a look at adding some attached image server side resizing functionality unless someone else picks this up....
Hi DavidIQ. Have you decided to take this project on? (That would be great!)
Only after the current version of ReIMG, which is 3.0, is completed and released. Then some of these newer features would be considered for addition into version 3.1. Not really close to looking at that just yet though.
Thanks for the reply. When you say "...for addition into version 3.1...", are you thinking that the server-side resizing of images (on upload to the server, by members) functionality would be part of the ReIMG mod/extension? It seems like a completely different beast, even though both utilize "resizing" functionality.

Not sure if any of this is valid or valuable, but in a quick search for resize-on-upload php scripts I found:
(might have to upload an image, resize and store in server, then delete original image from server?)

(on the HotScripts.com site) http://www.hotscripts.com/search/php/up ... age+resize

and...

http://www.w3bees.com/2013/03/resize-im ... g-php.html

http://www.9lessons.info/2009/03/upload ... h-php.html

http://blazonry.com/scripting/upload-size.php

http://stackoverflow.com/questions/1302 ... oad-script

User avatar
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 16641
Joined: Thu Jan 06, 2005 1:30 pm
Location: Fishkill, NY
Name: David Colón
Contact:

Re: Attached Images Resizer, Converter & File Size Reducer

Post by DavidIQ » Wed Jan 07, 2015 3:44 pm

dtleahy wrote:When you say "...for addition into version 3.1...", are you thinking that the server-side resizing of images (on upload to the server, by members) functionality would be part of the ReIMG mod/extension? It seems like a completely different beast, even though both utilize "resizing" functionality.
Yes it would be part of ReIMG as I don't plan on doing a separate extension since in reality it's all related. If one wants to reduce the file size server side they can have that option while also having the client side resizing, the combination of both being what people are asking for.
Apply to become a Jr. Extension Validator
My extensions | In need of phpBB services? | Was I helpful today?
No unsolicited PMs unless you're planning on asking for paid help.

User avatar
martti
Registered User
Posts: 559
Joined: Thu Jul 31, 2014 8:23 am
Location: Belgium

Re: Attached Images Resizer, Converter & File Size Reducer

Post by martti » Thu Jan 08, 2015 1:08 pm

People, image resizing is already build in core! The maximum size of images can be set and when someone tries to upload an image with exceding dimensions, it gets resized client-side before upload.

It's not clear in the ACP though (I only found out after investigating the code when I got interested after reading this topic):

In Attachment settings:
Image
Try for yourself!

Client side resizing before upload is the way to go IMO; it saves bandwidth (on upload) and processing power on your server.

But, one minor thing. However the images get downsized (and the filesize gets reduced), the maximum filesize checking applies to the original image size. Same way as other types of attachements get cheched on size. This seems not to be ideal. Maybe the core could be improved here or is there a way around it? Case: you want to limit pdf's to 1M but allow images up to 10M (they will be downsized at the client anyway.)
Last edited by martti on Thu Jan 08, 2015 1:51 pm, edited 2 times in total.

Holger
Registered User
Posts: 1603
Joined: Tue Mar 12, 2002 3:54 pm
Location: Hannover

Re: Attached Images Resizer, Converter & File Size Reducer

Post by Holger » Thu Jan 08, 2015 1:14 pm

martti wrote:Client side resizing before upload is the way to go IMO; it saves bandwidth (on upload) and processing power on your server.
This is available for phpBB 3.0.12: http://phpbb.se/forum/viewtopic.php?p=52039#p52039
Are you looking for a phpBB Expert? Find a phpBB Expert!
Are you a phpBB Expert? Post your resume!
http://www.phpbbexperts.com

User avatar
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 16641
Joined: Thu Jan 06, 2005 1:30 pm
Location: Fishkill, NY
Name: David Colón
Contact:

Re: Attached Images Resizer, Converter & File Size Reducer

Post by DavidIQ » Thu Jan 08, 2015 2:11 pm

martti wrote:People, image resizing is already build in core! The maximum size of images can be set and when someone tries to upload an image with exceding dimensions, it gets resized client-side before upload.
I think you're a little confused about what is being asked for here. There is no functionality in the core to reduce file size of uploaded images whatsoever. What you are referring to in your screenshot is a setting that prevents uploading of images larger than the specified dimensions. If that limit is exceeded by the image being uploaded then the upload is rejected. Likewise if the files size limit that is set for attachments is exceeded the attachment is also rejected.

The request here is to automatically do the size reductions necessary to meet the upload requirements set and not task an otherwise computer-unsavvy person with reducing an image's dimensions and/or file size.
Apply to become a Jr. Extension Validator
My extensions | In need of phpBB services? | Was I helpful today?
No unsolicited PMs unless you're planning on asking for paid help.

User avatar
martti
Registered User
Posts: 559
Joined: Thu Jul 31, 2014 8:23 am
Location: Belgium

Re: Attached Images Resizer, Converter & File Size Reducer

Post by martti » Thu Jan 08, 2015 2:15 pm

DavidIQ wrote:
martti wrote:People, image resizing is already build in core! The maximum size of images can be set and when someone tries to upload an image with exceding dimensions, it gets resized client-side before upload.
I think you're a little confused about what is being asked for here. There is no functionality in the core to reduce file size of uploaded images whatsoever. What you are referring to in your screenshot is a setting that prevents uploading of images larger than the specified dimensions. If that limit is exceeded by the image being uploaded then the upload is rejected. Likewise if the files size limit that is set for attachments is exceeded the attachment is also rejected.

The request here is to automatically do the size reductions necessary to meet the upload requirements set and not task an otherwise computer-unsavvy person with reducing an image's dimensions and/or file size.
I'm not confused. Please try yourself. The pictures get resized client-side. This is built in the plupload javascript library phpBB uses.

Holger
Registered User
Posts: 1603
Joined: Tue Mar 12, 2002 3:54 pm
Location: Hannover

Re: Attached Images Resizer, Converter & File Size Reducer

Post by Holger » Thu Jan 08, 2015 2:16 pm

:shock:
Are you looking for a phpBB Expert? Find a phpBB Expert!
Are you a phpBB Expert? Post your resume!
http://www.phpbbexperts.com

User avatar
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 16641
Joined: Thu Jan 06, 2005 1:30 pm
Location: Fishkill, NY
Name: David Colón
Contact:

Re: Attached Images Resizer, Converter & File Size Reducer

Post by DavidIQ » Thu Jan 08, 2015 2:22 pm

martti wrote:
DavidIQ wrote:
martti wrote:People, image resizing is already build in core! The maximum size of images can be set and when someone tries to upload an image with exceding dimensions, it gets resized client-side before upload.
I think you're a little confused about what is being asked for here. There is no functionality in the core to reduce file size of uploaded images whatsoever. What you are referring to in your screenshot is a setting that prevents uploading of images larger than the specified dimensions. If that limit is exceeded by the image being uploaded then the upload is rejected. Likewise if the files size limit that is set for attachments is exceeded the attachment is also rejected.

The request here is to automatically do the size reductions necessary to meet the upload requirements set and not task an otherwise computer-unsavvy person with reducing an image's dimensions and/or file size.
I'm not confused. Please try yourself. The pictures get resized client-side. This is built in the plupload javascript library phpBB uses.
Yes you're right. New feature that is included with plupload. The only thing is that this doesn't reduce the file size it seems, which is the request here.
Apply to become a Jr. Extension Validator
My extensions | In need of phpBB services? | Was I helpful today?
No unsolicited PMs unless you're planning on asking for paid help.

User avatar
martti
Registered User
Posts: 559
Joined: Thu Jul 31, 2014 8:23 am
Location: Belgium

Re: Attached Images Resizer, Converter & File Size Reducer

Post by martti » Thu Jan 08, 2015 2:28 pm

DavidIQ wrote: Yes you're right. New feature that is included with plupload. The only thing is that this doesn't reduce the file size it seems, which is the request here.
It does reduce the filesize of course. But checking the maximum filesize is against the original filesize. Here is room for improvement I think. Example: you want to allow pdf's up to 1M but images up to 10M (they get downsized client side anyway when you set maximum dimensions.)

Post Reply

Return to “Extension Requests”

Who is online

Users browsing this forum: Andimp3, DWFII, karbiko, Lumpy Burgertushie and 9 guests