news module and resize of images...

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
User avatar
confiq
Forum Members
Forum Members
Posts: 21
Joined: Sat Sep 27, 2008 8:00 am

news module and resize of images...

Post 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?
lainyrache
Forum Members
Forum Members
Posts: 106
Joined: Thu Oct 05, 2006 11:27 am

Re: news module and resize of images...

Post 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?
nicmare
Power Poster
Power Poster
Posts: 1150
Joined: Sat Aug 25, 2007 9:55 am

Re: news module and resize of images...

Post 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?
User avatar
confiq
Forum Members
Forum Members
Posts: 21
Joined: Sat Sep 27, 2008 8:00 am

Re: news module and resize of images...

Post 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.
lainyrache
Forum Members
Forum Members
Posts: 106
Joined: Thu Oct 05, 2006 11:27 am

Re: news module and resize of images...

Post 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.
User avatar
confiq
Forum Members
Forum Members
Posts: 21
Joined: Sat Sep 27, 2008 8:00 am

Re: news module and resize of images...

Post 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
User avatar
confiq
Forum Members
Forum Members
Posts: 21
Joined: Sat Sep 27, 2008 8:00 am

Re: news module and resize of images...

Post 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...
Frankie

Re: news module and resize of images...

Post 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?  ???
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: news module and resize of images...

Post 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?...
User avatar
confiq
Forum Members
Forum Members
Posts: 21
Joined: Sat Sep 27, 2008 8:00 am

Re: news module and resize of images...

Post 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/
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: news module and resize of images...

Post 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...
User avatar
blast2007
Power Poster
Power Poster
Posts: 508
Joined: Wed Aug 01, 2007 5:36 pm

Re: news module and resize of images...

Post 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
Post Reply

Return to “Modules/Add-Ons”