Resample Big Attached Images

Started by Naturforum, January 11, 2006, 12:33:17 PM

Previous topic - Next topic

BjornB

I have used this mod for some time, and know about the xml  edit, but it didn't work this time. I'll give it another try using your files.

Bjorn

BjornB

Hi,


This is the error I receive: Fatal error: Call to undefined function: exif_imagetype() in /home/username/public_html/domain/forum/Sources/Post.php on line 1477

Idea what to do?

Thanks de Bjorn

TrueSatan

 Your server probably lacks the necessary support for it or the images aren't compatible with the system...rare but entirely possible. Short of swapping hosting or asking your host to enable the systems you need there's not much that can be done...sorry.

If you want to see what the php setup on your host is then use the file below...upload it to your server then using your browser load the file...it will output onto the browser screen the php configuration details of your hosting.

BjornB

Thanks TrueSatan,

Just found that out. I'm contacting my host to have them '--enable-exif'. Shouldn't be a problem I hope. Everyone else has it  :)

TrueSatan

My pleasure...and good luck...I hope it works out well for you.

BjornB

Host added exif to server and mod is working now.  :D

TrueSatan

Glad to hear it...it's nice to hear somebody say something good once in a while after a few hours dealing with a idiot trying to wreck one of my forums. You put a, much needed, smile back on my face.

Matthew Schenker

This looks like a terrific mod, something I have really been wanting.

Just to be clear, has it been updated to run on 1.1.2?

Thanks!

TrueSatan

Matthew,

As stated above,
Quote
The version below adds support for SMF 1.1.1 and 1.1.2

Use the version in my posting and you should be OK.

Matthew Schenker

TrueSatan,
Thanks for the note!  Sorry if I asked a question that was already answered.  Since I'm still learning, and I'm not a programmer, sometimes I ask for more reassurance.  I'm getting better!

Thank you again.  You are always such a great help.  And it is wonderful the way you put such effort into tweaking modifications to help make them better.  I really appreciate that!!

TrueSatan

 Thanks Matthew,

I hope the mod works out well for you...it was a bit of a pain to tweak for the latest versions but now that it has my updated install file for those versions in the package adding new versions to it as they come along should be easy...just a matter of adding the version number to the compatibility list...unless something gets changed in the SMF core files again.

I found that it clashes with the sticky first post mod and haven't yet got them to work together...that aside it should be fine.

Matthew Schenker

I've installed this in my test forum.  Just want to confirm the purpose of this modification.  It reduces the pixel size, not the KB size.

TrueSatan

 Correct Matthew...by limiting pixel size it stops excessively large images from distorting the layout of your forum.

Matthew Schenker

This is a useful modification.

But does anyone know if there is a modification available that will resize attachments automatically?  I mean, one that reduces the KB size.  This would be really useful.

TrueSatan

 I'm pretty sure that there isn't any such package...

Matthew Schenker

TrueSatan,
You know what my next question is, right?  Can one of you experts develop something like this?

I'm not a programmer, so I apologize if my request is silly.

TrueSatan

Matthew,

I could feel that question coming from afar...but I had fingers, toes and all else that would cross crossed and hoped for the best.

I've had a look through the php EXIF function documentation and that of GD2 and can't see an obvious way to use either to do what you ask. Doubtless it can be done (most things can be done) but I don't know how to do it.

BTW expert...no; bodger...yes!

TRT

This mod killed the ability for me or my users to attach ANY file.

Looks like my host needs to enable exif for me also. I get the above mentioned fatal error when trying to attach any file, image or otherwise.

I uninstalled it, and everything works like it should. I'll reinstall it once I have exif enabled and see if it continues to give me problems.

Using SMF v1.1.2, GD 2.0.28, and no exif listed with phpinfo.

Jaba

Quote from: TrueSatan on March 02, 2007, 05:00:35 AM
The mod is very general purpose as regards SMF versions and just needed an alteration to the package XML...the mod is now tested on 1.1.2 and works properly...assuming all the previous caveats in earlier postings are covered.

I would expect that it would be easy to keep it up to date unless the associated SMF files change drastically and, unless anyone objects, I'll probably post uprated versions as new SMF versions become available...I might do some modifications to the code as well but don't count on that as for my own use it's fine as it is.

If the developer wants me to do so I'll look after this mod...that's up to him though.

The version below adds support for SMF 1.1.1 and 1.1.2
Hi TrueSatan
I'm using 1.1.3 - Server support GD2 and Exif etc!
I edited the package-info.xml and included 1.1.3 and it installed fine.

I got the following error after installing when trying to upload an image in a post, jpg or gif etc!
"An Error Has Occurred!
Your attachment couldn't be saved. This might happen because it took too long to upload or the file is bigger than the server will allow.
Please consult your server administrator for more information."


FYI:
I also noticed that it will not allow retry after failing!
will not allow new attachment to upload and the post post has to be aborted even if the image link is removed!

I've only done very simple edits with PHP but I'm will to have a go if you or someone can point me in the general direction? If it's a simple edit cough...   :P

TrueSatan

 First off a quick update to add support for SMF 1.1.3...file attached (other versions are still supported in the new package.)

Unfortunately your problems isn't an easy, or quick, one to fix...the database on your forum has had the details of the problem image added to it but the actual upload of the image failed...hence the problem. You can't re-upload the image because your forum database thinks it's already there...likewise it won't let the posting continue for the same reason.

You could upload the image via ftp having resized it manually and thus bring database and files back into step (easier than altering the database) and then delete the atachment via the normal ACP methods.

Fortunately this would be a rare occurance but right now I don't see an obvious way out of it...I'll ponder on it at some time when I have more spare time available (though that doesn't happen too often.)

Advertisement: