<?xml version="1.0" encoding="utf-8"?>
<!-- generator="CMF " -->
<rss version="0.91">
    <channel>
        <title>verot.net - class.upload.php forum</title>
        <description><![CDATA[class.upload.php latest posts on verot.net]]></description>
        <link>http://www.verot.net/</link>
        <lastBuildDate>Sun, 20 Jul 2008 01:59:24</lastBuildDate>
        <generator>CMF </generator>
        <item>
            <title>Image sandwich</title>
            <link>http://www.verot.net/php_class_upload_forum.htm&amp;php_class_upload_forum_id=2536</link>
            <description><![CDATA[<i>by Tim, 2 days, 7 hours ago<br />1 reply, last reply 2 days, 3 hours ago</i><br /><br />I want to sandwich 2 images together almost a watermark application but more like grading an image on the fly, so a water mark the same size as the original with reduced opacity so that image underneath still comes through, is this possible?]]></description>
            <author>Tim</author>
            <pubDate>Thu, 17 Jul 2008 16:02:00</pubDate>
        </item>
        <item>
            <title>No Image resize on localhost</title>
            <link>http://www.verot.net/php_class_upload_forum.htm&amp;php_class_upload_forum_id=2522</link>
            <description><![CDATA[<i>by Alex, 4 days, 4 hours ago<br />1 reply, last reply 4 days, 3 hours ago</i><br /><br />I use the following code:<br /><br /><pre class="code php">$upload = new Upload($file);
$upload->image_resize = true;
$upload->image_ratio = true;
$upload->image_x = 150;     	  	
$upload->image_convert  = 'jpg';
$upload->jpeg_quality = 100;
$upload->file_overwrite = true;
$upload->auto_create_dir = true;
$upload->file_auto_rename = false;
$upload->file_new_name_body = 'screen_thumb_'.$id;
$upload->process($dir);</pre><br />The file gets uploaded but no resizing is done! Even more strange is when I display the log the following is shown:<br /><br /><b>system information</b><br />- GD version              : 2.0.34<br />- supported image types   : png jpg gif bmp<br />- open_basedir            : no restriction<br />- language                : en_GB<br /><b>source is an uploaded file</b><br />- upload OK<br />- file name OK<br />- source variables<br />    file_src_name         : ccg 4.jpg<br />    file_src_name_body    : ccg 4<br />    file_src_name_ext     : jpg<br />    file_src_pathname     : C:\xampp\tmp\php5FAF.tmp<br />    file_src_mime         : application/octet-stream<br />    file_src_size         : 3428460 (max= 33554432)<br />    file_src_error        : 0<br /><b>process file to /xampp/htdocs/test/public/img/gallery/4/\</b><br />- file size OK<br />- file mime OK : application/octet-stream<br />- new file name ext : jpg<br />- new file name body : screen_thumb_169<br />- file name safe format<br />- destination variables<br />    file_dst_path         : /xampp/htdocs/test/public/img/gallery/4/\<br />    file_dst_name_body    : screen_thumb_169<br />    file_dst_name_ext     : jpg<br />- no image operation, keep extension<br />- no auto_rename if same filename exists<br />- destination file details<br />    file_dst_name         : screen_thumb_169.jpg<br />    file_dst_pathname     : /xampp/htdocs/test/public/img/gallery/4/\screen_thumb_169.jpg<br />- no overwrite checking<br />- no image processing wanted<br />- <b>process OK</b><br /><br /><br />See the "- no image processing wanted" line. I don't get it.<br /><br />I use XAMPP on localhost]]></description>
            <author>Alex</author>
            <pubDate>Tue, 15 Jul 2008 19:32:00</pubDate>
        </item>
        <item>
            <title>Workaround mime type octet</title>
            <link>http://www.verot.net/php_class_upload_forum.htm&amp;php_class_upload_forum_id=2509</link>
            <description><![CDATA[<i>by Jean Rumeau, 6 days, 17 hours ago<br />0 replies</i><br /><br />Im playing with the fancyupload and came with this problem i change line 2257 of 0.25<br /><br />from:<br />$this->file_src_mime = $file['type'];<br /><br />to:<br />$this->file_src_mime = ($imgInfo = @getimagesize($this->file_src_pathname)) ? $imgInfo["mime"] : $file['type'];<br /><br />so if imagesize can get the mime type we use this or the mime type of the form in case is not an image.<br /><br />i would like to know if this is a good solution instead of checking the extension to determine the type of file.]]></description>
            <author>Jean Rumeau</author>
            <pubDate>Sun, 13 Jul 2008 06:59:00</pubDate>
        </item>
        <item>
            <title>Portrait getting wrong orientation</title>
            <link>http://www.verot.net/php_class_upload_forum.htm&amp;php_class_upload_forum_id=2454</link>
            <description><![CDATA[<i>by Rick, 1 week, 1 day ago<br />2 replies, last reply 1 week, 1 day ago</i><br /><br />When I upload a portrait image, the image does resize correctly but only the orientation get changed. The resized image rotates 90 degrees CC. <br /><br />My upload.php:<br /><pre class="code php">include('class.upload.php');

$foo  =  new  Upload($_FILES['afb1']);  
if  ($foo->uploaded)  {
   //  save  uploaded  image  with  a  new  name,
   //  resized  to  100px  wide
   $foo->file_new_name_body  =  'image_resized';
   $foo->image_resize  =  true;
   $foo->image_x  =  450;
   $foo->image_y  =  600;
   $foo->image_ratio  =  true;
   $foo->Process('/var/www/nl/domain/www/images/');
   if  ($foo->processed)  {
     echo  'image  resized';
     $foo->Clean();
   }  else  {
     echo  'error  :  '  .  $foo->error;
   }
}</pre><br />The script works perfectly with landscape images. I really hope you can help me with this. I really like this script!]]></description>
            <author>Rick</author>
            <pubDate>Fri, 11 Jul 2008 14:44:00</pubDate>
        </item>
        <item>
            <title>Image failed to resize</title>
            <link>http://www.verot.net/php_class_upload_forum.htm&amp;php_class_upload_forum_id=2449</link>
            <description><![CDATA[<i>by Troy Moseley, 1 week, 3 days ago<br />1 reply, last reply 1 week, 3 days ago</i><br /><br />I can't seem to get the image to resize. Here's my code:<br /><br /><pre class="code php">if ($handle->uploaded) {
  $handle->file_new_name_body   = 'image_resized';
  $handle->image_resize         = true;
  $handle->image_x              = 640;
  $handle->image_ratio_y        = true;
  $handle->Process($image_folder);

  // we check if everything went OK
  if ($handle->processed) {
    // everything was fine !
    echo 'file uploaded with success';
    $info = getimagesize($handle->file_dst_pathname);
    echo '' . $info['mime'] . '  -  ' . $info[0] . ' x ' . $info[1] .'  -  ' . round(filesize($handle->file_dst_pathname)/256)/4 . 'KB';
    echo '  link to the file just uploaded: images/' . $handle->file_dst_name . '';
  } else {
    // one error occured
    echo 'file not uploaded to the wanted location';
    echo '  Error: ' . $handle->error . '';
  }

  // we delete the temporary files
  $handle-> Clean();

} else {
  // if we're here, the upload file failed for some reasons
  // i.e. the server didn't receive the file
  echo 'file not uploaded on the server';
  echo '  Error: ' . $handle->error . '';
}</pre><br />Here's the log print out:<br /><br /><i>link to the file just uploaded: 204688005_3.jpg<br />log info: system information<br />- GD version : GD not present<br />- supported image types : none<br />- open_basedir : no restriction<br />- language : en_GB<br />source is an uploaded file<br />- upload OK<br />- file name OK<br />- source variables<br />    file_src_name : 204688005.jpg<br />    file_src_name_body : 204688005<br />    file_src_name_ext : jpg<br />    file_src_pathname : /var/tmp/phpxX2Z7l<br />    file_src_mime : image/pjpeg<br />    file_src_size : 40577 (max= 10485760)<br />    file_src_error : 0<br />process file to ./images/<br />- file size OK<br />- file mime OK : image/pjpeg<br />- file name safe format<br />- destination variables<br />    file_dst_path : ./images/<br />    file_dst_name_body : 204688005<br />    file_dst_name_ext : jpg<br />- no image operation, keep extension<br />- checking for auto_rename<br />    auto_rename to 204688005_3.jpg<br />- destination file details<br />    file_dst_name : 204688005_3.jpg<br />    file_dst_pathname : ./images/204688005_3.jpg<br />- 204688005_3.jpg doesn't exist already<br />- no image processing wanted<br />- process OK</i><br /><br />Why does it say no image processing wanted? And what do I need to do to make it work...<br /><br />Thanks]]></description>
            <author>Troy Moseley</author>
            <pubDate>Wed, 09 Jul 2008 16:11:00</pubDate>
        </item>
        <item>
            <title>Upload image only</title>
            <link>http://www.verot.net/php_class_upload_forum.htm&amp;php_class_upload_forum_id=2447</link>
            <description><![CDATA[<i>by sophy, 1 week, 3 days ago<br />1 reply, last reply 1 week, 3 days ago</i><br /><br />I have just used class.upload.php. It work fine but I want upload image file only and other file don't allow.How can i do?]]></description>
            <author>sophy</author>
            <pubDate>Wed, 09 Jul 2008 07:01:00</pubDate>
        </item>
        <item>
            <title>Strange problem</title>
            <link>http://www.verot.net/php_class_upload_forum.htm&amp;php_class_upload_forum_id=2320</link>
            <description><![CDATA[<i>by Clone, 2 weeks, 1 day ago<br />1 reply, last reply 2 weeks, 1 day ago</i><br /><br />I've used the class several times on my localhost, so i'm sure that everything works fine there, and that all the needed libraries are installed.<br />Now with a new code, where i upload and image and process it 3 times something odd happens.<br />The process goes like this:<br />- Upload the image<br />- Create a thumbnail (width of 60 px if the image is portrait, or height of 60 px if it's landscape), this works just fine.<br />- Then, create a medium image (320 width if portrait, or 240 if landscape) this uses the default image width / height of 150 px, which is wrong.<br />- Then copy the image without resizing, this works ok.<br /><br />Here's the piece of code that doesn't work:<br /><pre class="code php">
$handle->image_resize = true;
if($handle->image_src_x > $handle->image_src_y){
  $handle->image_ratio_x = true;
  $handle->image_y = 240;
} else {
  $handle->image_ratio = true;
  $handle->image_x = 320;
}
$handle->Process(....);</pre><br />Any ideas?]]></description>
            <author>Clone</author>
            <pubDate>Fri, 04 Jul 2008 07:06:00</pubDate>
        </item>
        <item>
            <title>Unable to create thumbnail after successful upload</title>
            <link>http://www.verot.net/php_class_upload_forum.htm&amp;php_class_upload_forum_id=2307</link>
            <description><![CDATA[<i>by Erb, 2 weeks, 5 days ago<br />1 reply, last reply 2 weeks, 4 days ago</i><br /><br />Hello, all. I can't seem to resolve this issue. I am able to have a customer upload an image successfully, but I'm unable to create the thumbnail successfully. Here is the log and error - thanks in advance for your help.<br /><br />Error:<br />"Error in creating JPEG image from source."<br />User's browser: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)<br />User's email: xxxxxxxxx@yahoo.com<br />Additional: system information<br />- GD version : 2.0.34<br />- supported image types : png jpg gif bmp<br />- open_basedir : no restriction<br />- language : en_GB<br />source is an uploaded file<br />- upload OK<br />- file name OK<br />- source variables<br />    file_src_name : 008.jpg<br />    file_src_name_body : 008<br />    file_src_name_ext : jpg<br />    file_src_pathname : /tmp/phpFJgtEx<br />    file_src_mime : image/pjpeg<br />    file_src_size : 312299 (max= 78643200)<br />    file_src_error : 0<br />- source file is an image<br />    image_src_x : 1800<br />    image_src_y : 1200<br />    image_src_pixels : 2160000<br />    image_src_type : jpg<br />    image_src_bits : 8<br />process file to ./uploaded_files/<br />- file size OK<br />- file mime OK : image/pjpeg<br />- file name safe format<br />- destination variables<br />    file_dst_path : ./uploaded_files/<br />    file_dst_name_body : 008<br />    file_dst_name_ext : jpg<br />- no image operation, keep extension<br />- checking for auto_rename<br />- destination file details<br />    file_dst_name : 008.jpg<br />    file_dst_pathname : ./uploaded_files/008.jpg<br />- no overwrite checking<br />- no image processing wanted<br />- process OK<br />< b>process file to ./uploaded_files/<br />- file size OK- f ile mime OK : image/pjpeg<br />- file name body add : _tmb<br />- file name safe format<br />- destination variables<br />    file_dst_path : ./uploaded_files/<br />    file_dst_name_body : 008_tmb<br />    file_dst_name_ext : jpg<br />- image operation, keep extension<br />- checking for auto_rename<br />- destination file details<br />    file_dst_name : 008_tmb.jpg<br />    file_dst_pathname : ./uploaded_files/008_tmb.jpg<br />- no overwrite checking<br />- image resizing or conversion wanted]]></description>
            <author>Erb</author>
            <pubDate>Mon, 30 Jun 2008 15:34:00</pubDate>
        </item>
        <item>
            <title>Strange Problem when Process() twice</title>
            <link>http://www.verot.net/php_class_upload_forum.htm&amp;php_class_upload_forum_id=2269</link>
            <description><![CDATA[<i>by riscphree, 4 weeks, 1 day ago<br />10 replies, last reply 6 days, 20 hours ago</i><br /><br />I'm trying to create a thumbnail and an image (resized if it is too large). I am using a different upload mechanism though, swfupload.org  <br /><br />This code worked when I called it with a regular form, however, I have only been able to get it to either create the thumbnail or just upload the image (and if its too big, it won't resize). <br /><br />I tried using Clean() in there too, that didn't seem to help much. Here is the current code that will just produce two files of the original uploaded image (no resized thumbnail and no resized image)<br /><br /><pre class="code php">$handle = new Upload($_FILES['Filedata']);
if ($handle->uploaded) {
    $handle->image_convert = 'jpg';
    // lets make some changes to the images (resize, etc)
    $handle->image_resize = true;
    $handle->image_ratio_y = true;
    $handle->image_ratio_no_zoom_in = true;
    // Lets create a thumbnail! First width then height
    if($handle->image_src_x > 75){
        $handle->image_x = 75;
    }
    if($handle->image_src_y > 100){
        $handle->image_y = 100;
    }
    // lets rename this file
    $newfile = "$handle->file_src_name_body" . time();
    $newfile_p	= md5($newfile);
    $newfile_tn	= "tn" . md5($newfile);
    $handle->file_new_name_body = "$newfile_tn";
    $handle->Process("images/v");
    $thumbnail = $handle->file_dst_name;
    // done creating a thumbnail

    //$handle-> Clean();
    // lets begin with the image
    $handle->image_resize = true;
    $handle->image_ratio_y = true;
    $handle->image_ratio_no_zoom_in = true;
    // is our image too large? Lets resize
    if($handle->image_src_x >= 604){
        $handle->image_x = 604;
    }	
    if($handle->image_src_y >= 453){ 
        $handle->image_y = 453;
    }
    // end changes
    $handle->file_new_name_body = "$newfile_p";
        
    $handle->Process("images/v");
    $handle->Clean();
}</pre>]]></description>
            <author>riscphree</author>
            <pubDate>Fri, 20 Jun 2008 21:19:00</pubDate>
        </item>
        <item>
            <title>How to change class.upload name?</title>
            <link>http://www.verot.net/php_class_upload_forum.htm&amp;php_class_upload_forum_id=2183</link>
            <description><![CDATA[<i>by Marc, 1 month ago<br />3 replies, last reply 1 month ago</i><br /><br />Well, looks like a stupid question. <br /><br />I basically would like to use the class_upload within OsCommerce administration. Images manipulations are not exactly easy for unexperencied shop owner. Unfortunately, class with the same name (upload) already exists in OsC. <br /><br />I was expecting to "simply" change the name of the class from 'upload' to 'imagesupload' but then upload without any useful debug information. Any help would be welcome.<br /><br />I expect to post (with your permission) this addition as a OsCommerce contribution under a GPL license.<br /><br />Thanks for this EXCELLENT work and spirit.]]></description>
            <author>Marc</author>
            <pubDate>Sat, 14 Jun 2008 20:35:00</pubDate>
        </item>
    </channel>
</rss>
