• Welcome to WebsiteBaker Community Forum. Please log in or sign up.
Welcome, Guest
News
Support WebsiteBaker
Your donations will help to:
PayPal
  • Pay for our dedicated server
  • Pay for domain registration
  • and much more!
You can donate by clicking on the button below.

Some of my sites

Started by Ruud, March 10, 2008, 05:33:10 PM  ( Read 11,453 times )

Ruud


grid8400

looks okay..
was wondering what mod you used for  rietdijk auto / Voorraadlijst????
Is it a WB module???

    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


      grid8400


      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?


        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

          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

            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

              Stefek

              Thank you Ruud.

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

              Regards,
              Stefek

                nibz

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

                  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


                    \n\n