List:MySQL++« Previous MessageNext Message »
From:Warren Young Date:November 18 2008 5:02pm
Subject:Re: currupted image when sending jpeg using load_jpeg
View as plain text  
Michael O wrote:
> My only guess is that the 'load_image' is broken. 

Yes, on Windows it is.  The fix is simple:

> Index: examples/load_jpeg.cpp
> ===================================================================
> --- examples/load_jpeg.cpp      (revision 2412)
> +++ examples/load_jpeg.cpp      (working copy)
> @@ -74,7 +74,7 @@
>                         // We received at least one non-option argument on the
>                         // command line, so treat it as a file name 
>                         img_name = argv[ag_optind];
> -                       ifstream img_file(img_name, ios::ate);
> +                       ifstream img_file(img_name, ios::ate | ios::binary);
>                         if (img_file) {
>                                 size_t img_size = img_file.tellg();
>                                 if (img_size > 10) {

Thanks for reporting this.  The fix will appear in 3.0.7, which is 
imminent.  It's trivial enough that you can just hand-hack your code to 
work around the problem.

There's also some changes coming to cgi_jpeg which *may* impact Windows. 
  If you find that Query Browser returns the correct data but cgi_jpeg 
still isn't working right on Windows, you can grab the current version 
out of the svn repository here:

http://svn.gna.org/viewcvs/*checkout*/mysqlpp/trunk/examples/cgi_jpeg.cpp
Thread
currupted image when sending jpeg using load_jpegMichael O15 Nov
  • Re: currupted image when sending jpeg using load_jpegWarren Young18 Nov
    • FW: currupted image when sending jpeg using load_jpegMichael O18 Nov
      • Re: currupted image when sending jpeg using load_jpegWarren Young19 Nov
        • FW: currupted image when sending jpeg using load_jpegMichael O19 Nov