Page 1 of 1
news module and resize of images...
Posted: Tue Oct 07, 2008 7:16 pm
by confiq
Hi guys...
Still didn't see the code of news-module but i was wandering does news module has capabilities to resize upload image with GD? Cause i'm using file uploader for showing image in index page but if i want to keep design clean i have to resize the image I didn't see option for resizing in module... did i miss something or they wrote that way?
Re: news module and resize of images...
Posted: Wed Oct 08, 2008 7:54 am
by lainyrache
Image resizing is in image manager..threre is a small edit button below each image.
Though I am not sure if that is what you need?
Re: news module and resize of images...
Posted: Wed Oct 08, 2008 8:18 am
by nicmare
im also interested in an integrated or related resize function in news module.
i am using the module to upload images to every newsdrop. but allways have to resize them before uploading. thats not pretty smart. has got someone an idea?
Re: news module and resize of images...
Posted: Wed Oct 08, 2008 11:27 am
by confiq
no, it's not what i need.
I need when user will upload the image the news module (only news module) will resize it so it will fit to my needs.
Re: news module and resize of images...
Posted: Wed Oct 08, 2008 3:41 pm
by lainyrache
You can resize image via the wysiwyg so eg on tinymce you get the 'appearance' tab where you can resize Dimensions but not crop..
Not ideal as images should really be reduced in weight as well.
If you are looking to upload very large files and reduce/crop via the browser - i wouldn't want that on my server.
You can check this on the admin demo link from the top menu above.. news is in Admin menu/content.
Hope that helps.
Re: news module and resize of images...
Posted: Wed Oct 08, 2008 7:06 pm
by confiq
well, i'm using file upload system of news module to upload the image. The same image i'm using in my template so i'll show in index.
I call it, ex: {news template="index_with_image.tpl"}.
using wysiwyg is not a option.
I guess news module can't help me on this one...
Just wanted to check if something like this exist...
p.s. using <img for resizing picture is also not soooo good idea.
p.s.s. i think it should not be so hard to write, if i write it i'll post the patch.
best regards
Re: news module and resize of images...
Posted: Thu Oct 09, 2008 12:00 am
by confiq
here is it....
Code: Select all
[confiq@server News]$ diff News.module.php News.module.php.backup
681,693c681,687
< // start - generate thumbnail image
< if ($_POST[m1_category] == 2 && @getimagesize($_FILES[$fieldname]['tmp_name'])) {
< $dest = cms_join_path($config['uploads_path'],'news','id'.$itemid,"index_$itemid.jpg");
< $this->image_transform($_FILES[$fieldname]['tmp_name'],$dest,135);
< }
< // end
< else {
< if( @cms_move_uploaded_file($_FILES[$fieldname]['tmp_name'], $dest) === FALSE )
< {
< $error = $this->Lang('error_movefile',$dest);
< return FALSE;
< }
< }
---
>
> if( @cms_move_uploaded_file($_FILES[$fieldname]['tmp_name'], $dest) === FALSE )
> {
> $error = $this->Lang('error_movefile',$dest);
> return FALSE;
> }
>
742d735
<
It took me few hours just to find where and what to edit... i hope it helps somebody...
Re: news module and resize of images...
Posted: Mon Jul 27, 2009 11:34 pm
by Frankie
confiq wrote:It took me few hours just to find where and what to edit... i hope it helps somebody...
i'd love to try out this patch, where should it be applied?

Re: news module and resize of images...
Posted: Tue Jul 28, 2009 1:16 am
by Dr.CSS
You may want to let anyone know if they use this they render their install of news unsupportable...
How come you didn't just use css to make it the size you wanted?...
Re: news module and resize of images...
Posted: Tue Jul 28, 2009 7:59 pm
by confiq
Cause at that time i didn't know that i can fix resized image in MSIE with
Code: Select all
img { -ms-interpolation-mode: bicubic; }[1]
The question still reminds, does all modern browsers know to resize image without destroying it?
[1]
http://css-tricks.com/ie-fix-bicubic-sc ... or-images/
Re: news module and resize of images...
Posted: Tue Jul 28, 2009 8:20 pm
by Dr.CSS
I was just saying that if you can target the image like .NewsSummary img then you can set one value, width or height, and the other will change proportionately in any browser...
Re: news module and resize of images...
Posted: Tue Jul 28, 2009 10:26 pm
by blast2007
confiq wrote:
...Still didn't see the code of news-module but i was wandering does news module has capabilities to resize upload image with GD?
Are
these tricks useful for your needs?
regards
blast