FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum » FUDforum Suggestions » Automatic Image Resizing (resize uploaded images.)  () 2 Votes
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Automatic Image Resizing [message #35909 is a reply to message #35821] Tue, 20 February 2007 08:50 Go to previous messageGo to previous message
magli is currently offline  magli   Italy
Messages: 15
Registered: February 2007
Location: Meran, Italy
Karma:
Junior Member
In case anybody is interested, here is the simple solution I used to automatically resize all my uploaded images:

in the file src/getfile.php.t, before the last line (@readfile($r[2]);), I added:

if ($r[0]=="image/jpeg" || $r[0]=="image/png" || $r[0]=="image/tiff") 
        {
                $size = getimagesize($r[2]);
                if ($size[0]>800) system("mogrify -resize 800 ".$r[2]);
        }


This will make sure that all images (jpeg,png and tiff) which have been uploaded to the forum are resized to a maximum width of 800.

It would probably make more sense to add this code into attach.inc.t, so that the resizing is done when the image is uploaded, instead of when it is viewed - but I want it to resize all the already-uploaded images as well.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Newsgroup synchronizing
Next Topic: Anchors
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Wed Nov 27 07:54:09 GMT 2024

Total time taken to generate the page: 0.05820 seconds