Some of my sites

Ruud

Quote from: nibz on September 24, 2008, 11:00:17 PM
Many thanks!, It realy takes time to uplode the images, but it's a good addition to the module

That is the penalty for a consistent image size.
My customer didn't know how to resize images, so this was the best solution. The only other solution was to install software and do a training session on image resizing. I liked this better.

Ruud

[url=https://dev4me.com/modules-snippets/]Dev4me - WebsiteBaker modules[/url] - [url=https://wbhelp.org/]WBhelp.org[/url]

nibz

Many thanks!, It realy takes time to uplode the images, but it's a good addition to the module

Stefek

Thank you Ruud.

I'll get back to this trick once I need it.
Very helpful modification.

Regards,
Stefek
[i]"Gemeinsam schafft man mehr."[/i]

[b][url=http://duden.de/rechtschreibung/gemeinsam#Bedeutung1]gemeinsam[/url][/b]
1. mehreren Personen oder Dingen in gleicher Weise gehörend, eigen
2. in Gemeinschaft [unternommen, zu bewältigen]; zusammen, miteinander
#Duden

Ruud

Yes, you could use this (it might need a bit of modification for filename variables) anywhere.
I used it in the Catalogs module so my customer could upload pictures from his camera directly to the module.
The images were fixed on 640px width. (example)

This simple method will overwrite the original image, so that one is lost.
The line: $new_image->setNewFile($nuevo_sitio); sets the output file. So a new filename would create a resized copy.

The size of the image you can upload and resize depends a bit on your host. It takes pretty much memory and time to resize large images. My dev server had problems with really big (8mpx) images, where my host server didn't have problems.

Ruud
[url=https://dev4me.com/modules-snippets/]Dev4me - WebsiteBaker modules[/url] - [url=https://wbhelp.org/]WBhelp.org[/url]

Stefek

It looks interesting, but I can't really follow you.
Which module do you use it in... and (more important) can this snippet be also used for another modules where I have the need to upload images (so they would be resized)?
And what happens with the original ones (5+ MegaPix)?

Best Regrards,
Stefek
[i]"Gemeinsam schafft man mehr."[/i]

[b][url=http://duden.de/rechtschreibung/gemeinsam#Bedeutung1]gemeinsam[/url][/b]
1. mehreren Personen oder Dingen in gleicher Weise gehörend, eigen
2. in Gemeinschaft [unternommen, zu bewältigen]; zusammen, miteinander
#Duden

Ruud

It was a long time ago, but I think this was all...

In the file save_pic.php add the following code just before the line (77) that says:
//guardar el file en la base de datos

Code to add:

//Resizer
// Check if the original image is greater than the max_size
if (is_file($nuevo_sitio)) {
   $image_info = getimagesize($nuevo_sitio);
}
   
$max_width = 640;
//If the image is wider than the max size resize it
if ($image_info[0] > $max_width && $max_width > 0) {
   echo ( 'Resizing');
    // Instantiate the GD class.
   $new_image = new GD;
   // Set parent image path and thumbnail path.
   $new_image->setFile($nuevo_sitio);
   $new_image->setNewFile($nuevo_sitio);
   // Resize image.
   $new_image->getImageInfo();
   $new_image->calcSize_thumb($max_width);
   $new_image->createImage();
}
// End Resizer


Good luck.

Ruud
[url=https://dev4me.com/modules-snippets/]Dev4me - WebsiteBaker modules[/url] - [url=https://wbhelp.org/]WBhelp.org[/url]

nibz

Small question, i want to use this module to, but i don't know how i can make a rezise tool, can you please explain?


GRID8400

Our WB websites: KEY2DESIGN & KEY2PICTURE

Ruud

Quote from: GRID8400 on March 10, 2008, 07:49:29 PM
was wondering what mod you used for  rietdijk auto / Voorraadlijst????
Is it a WB module???

Yes, it is a slightly modified version of the (not yet supported, but well working) catalog module.
https://forum.WebsiteBaker.org/index.php/topic,1463.0.html

I changed the smarty templates a bit so that it would use the lightbox2 module javascript on the details page.
I also added a small resize routine (copy/change/paste from the lightbox2 mod), so my car delaers can upload their 5+ megapixel images directly.
I now have 3 sites running this, and the customers love it.

Ruud

[url=https://dev4me.com/modules-snippets/]Dev4me - WebsiteBaker modules[/url] - [url=https://wbhelp.org/]WBhelp.org[/url]

GRID8400

looks okay..
was wondering what mod you used for  rietdijk auto / Voorraadlijst????
Is it a WB module???
Our WB websites: KEY2DESIGN & KEY2PICTURE

Ruud

Ok,

Time to show some of my work.

My own site:
www.allwww.nl

Some customers
www.golfbanenspanje.nl
www.koppelwebwatch.nl
www.unitautos.nl
www.rietdijkauto.nl

Please be nice to me  :wink:

Ruud
[url=https://dev4me.com/modules-snippets/]Dev4me - WebsiteBaker modules[/url] - [url=https://wbhelp.org/]WBhelp.org[/url]