I am having problems with one I wrote for a simple application for my corporation. I was hoping you could help.

here is my code. I have tried jpeg2wbmp, imagewbmp, image2wbmp I get either no iamge or a white image. Any help you could provide would be awesome!

 
   //LOCATIONS of FILES
    $ImgURL="http://www.domain.com/image_folder/products/SKU.jpg";
    $DestFile="/location/to/final_SKU.wbmp";
    $TempFile="/location/to/tmp_SKU.jpg";
    $FinalName="/location/to/finalized/wbmp/SKU.wbmp";

//Move final to FTP folder and delete temp files
copy($ImgURL, $TempFile); 
if (file_exists($DestFile)) {
 unlink($DestFile);
};
jpeg2wbmp($TempFile, $DestFile,80,80,0);
rename($DestFile, $FinalName);
unlink($TempFile);
    10 days later

    I have the same problem. I get an empty output. Please let me know if you've found a solution.

      This is a script I made that lets users upload logos/images that represent themselves. Did it for a website a while back. I don't think its the cleanest code, but it works... you'll have to kind of figure out how it works yourself... but I'll describe what it does below and you should be able to figure it out I think.

      Select Image
      Upload Image to Temp. Directory
      Resample Image if larger than max size
      Move image to final destingation folder
      Delete Temp File

      My max sizes were; x:180 y:220 which you can change of course to match your application.

      I found it really difficult to get the image resampling to work, I have another script without that if you don't need that aspect.

        hmm.. what i want to do is also to convert the jpeg to wbmp. any ideas how to do that?

          What are you doing with the file that you need it to be a WBMP? just curious.

            I need a script that would convert JPG pics to WBMP so that I could look at them on my cell phone. But jpeg2wbmp() doesnt work so far 🙁

              The thing to note is that WBMP images are purely bilevel - black and white, basically. A straightforward JPEG->WBMP mapping is not going to be pretty.

                have you seen an example of jpeg->wbmp conversion even if it's not pretty?

                  Write a Reply...