Subject:*
<
Name/Email:*
<
Message Icon:*
<
Select*
<
Message:*
<



Click the Preview to see the content in action.
Options:*
<
Confirmation Code*
<
8 + 9 = ?  
Input the result from the expression
Maximum attempts you can try: 10
*
<
   

Re: Uploading and resizing images
by sceilig on 2006/8/4 15:39:15

I did actually create a hack to handle image resizing - i added a function called XoopsMakeThumbnail() to the class/uploader.php file

A rough implementation of it would be this:
le="color: #000000"><?php include_once XOOPS_ROOT_PATH . "/class/uploader.php"; $allowed_mimetypes = array('image/gif', 'image/jpeg', 'image/pjpeg', 'image/x-png'); $uploader = new XoopsMediaUploader($persdir, $allowed_mimetypes, $maxfilesize, $maxfilewidth, $maxfileheight); if ($uploader->fetchMedia('foto')) { if (!$uploader->XoopsMakeThumbnail()) { $output_str .= $uploader->getErrors(); } else { $foto = $uploader->savedFileName; } } else { $output_str .= $uploader->getErrors(); }


My function calculates how much to resize the image so that it is reduced to either the maxwidth or maxheight. Then since I use imagemagick, I resize the image that way.

However, i never published the hack and wouldnt until it was streamlined with having more parameters (choosing GD, netpbm or imagemagick and their paths). And whoever was to use would need to know their way around xoops.

Alternatively, you could use the imanager or ibrowser plugins with a html editor module like TinyEditor - you can upload a photo and specify a number of different resizes to be made from it.
Re: Uploading and resizing images
by 3lr0n on 2006/8/4 14:39:07

Lol, ta for the answer but i dont have any code aptitudes to do this lol :P

btw.. with the uploader.. can i use an url instead of a local file?, can someone put an url in the box and upload it to my server?

ta in advance
Re: Uploading and resizing images
by Djiman on 2006/8/4 13:27:55

There are some nice 'upload script ' to upload images scattered over the net - some are easy to use to incorporate - some are safer than others.
[edit]
the above example is interesting
you may also use this one an example to find even more deeper:: http://www.maaking.com/
Re: Uploading and resizing images
by zoullou on 2006/8/4 13:18:56

Here is a good "framework" to work with image : PEAR::Image_Transform

Cheers
Re: Uploading and resizing images
by Will_H on 2006/8/4 13:04:17

Ah the age old question of using imagemagick or gd to create thumbnails through XOOPS. To this day mine still doesnt work properly. So if you find a solution it would be an aid to the entire community. Especially a solution that would be universal across all modules. A core hack that would ensure resizing of images posted in news, forums, and blocks would be ideal.

Good Luck.

Who's Online

383 user(s) are online (337 user(s) are browsing Support Forums)


Members: 0


Guests: 383


more...

Donat-O-Meter

Stats
Goal: $15.00
Due Date: Jul 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $15.00
Make donations with PayPal!

Latest GitHub Commits