Announcement

Collapse
No announcement yet.

Picture from VB4

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • [Forum] Picture from VB4

    Hi,

    VB4 users pictures can keep on HDD with extension .jpg or .png ?

    Best Regards,

  • #2
    Sorry, but that question as written makes no sense. Try rephrasing it. And maybe include a screenshot.

    Comment


    • #3
      Originally posted by nicutdk View Post
      if VB4 have possibility to change the the files ("1.attach", "2.attach"....) into ("1.jpg", "2.jpg".....) it is very simple with this script.

      You can try to use this script and works fine (just change RewriteRule .(attach|jpeg|jpg|png)$ /images/watermark.php [QSA,NC]) but if you store in VB4 other files (mp3, avi....) you have a problem.

      solution would be if VB4 can make possibility to store pictures files into folder with normal extension not a .attach
      Take a look at
      http://www.vbulletin.com/forum/showt...20#post2027220

      Comment


      • #4
        I would have no problem including a watermark in my own images, but if you want to watermark every image anyone uploads that will be harder. I think the add-ons like Photopost do it.

        Comment


        • #5
          Originally posted by Videx View Post
          I would have no problem including a watermark in my own images, but if you want to watermark every image anyone uploads that will be harder. I think the add-ons like Photopost do it.
          if you use this code with .htaccess wil not be a harder IT IS VERY EASY !!!

          If exist a method to put files in directory with normal extension (.jpg, .png) will be great.

          P.S. This script modify image just with X>500 pixel

          <?php
          $path = $_SERVER['DOCUMENT_ROOT'].$_SERVER['REQUEST_URI'];
          $image = imagecreatefromstring(file_get_contents($path));
          $w = imagesx($image);
          if ($w > 500) {
          $h = imagesy($image);
          $watermark = imagecreatefrompng('watermark.png');
          $ww = imagesx($watermark);
          $wh = imagesy($watermark);
          imagecopy($image, $watermark, $w-$ww, $h-$wh, 0, 0, $ww, $wh);
          }
          header('Content-type: image/jpeg');
          imagejpeg($image);
          exit();
          ?>

          Comment


          • #6
            nobody ?

            Comment


            • #7
              You'd need to watermark the image when they are uploaded and before they are converted to .attach. Takes hacking the code but the php you posted is along the right lines.

              Comment


              • #8
                I change files storage from database to directory.

                I make this script.

                .htaccess

                Code:
                RewriteEngine On
                RewriteCond %{REQUEST_FILENAME} -f
                RewriteRule .(attach)$ /fisiere/watermark.php [QSA,NC]

                watermark.php

                PHP Code:
                <?php 
                $path 
                $_SERVER['DOCUMENT_ROOT'].$_SERVER['REQUEST_URI']; 
                $image imagecreatefromstring(file_get_contents($path)); 
                $w imagesx($image); 
                if (
                $w 50) { 
                $h imagesy($image); 
                $watermark imagecreatefrompng('watermark.png'); 
                $ww imagesx($watermark); 
                $wh imagesy($watermark); 
                imagecopy($image$watermark$w-$ww$h-$wh00$ww$wh); 

                header('Content-type: image/jpeg'); 
                imagejpeg($image); 
                exit(); 
                ?>

                I see watermark at this address

                But at this address watermark not working

                Please help me with that.

                Best Regards,
                Last edited by nicutdk; Wed 18 Aug '10, 9:58pm.

                Comment

                widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                Working...
                X