in reply to Re^2: About GD Image Data Output Methods
in thread About GD Image Data Output Methods [SOLVED]

Try this version:

my $gd = $image->gd; my( undef, $width, $height, undef, undef ) = unpack 'nnnCV', substr( $ +gd, 0, 11, '' ); my $len = length( $gd ) / 4 * 3; my $bmp = pack 'a2 V V V l< l< l< v v V V l< l< V V', 'BM', $len + 54, 0, 54, 40, $width, -$height, 1, 24, 0, $len, 0, 0 +, 0; $bmp .= join'', unpack '(xaaa)*', $gd;

Looks like I had two fields transposed; even though my image viewer didn't notice (or just didn't look).


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority". I'm with torvalds on this
In the absence of evidence, opinion is indistinguishable from prejudice. Agile (and TDD) debunked

Replies are listed 'Best First'.
Re^4: About GD Image Data Output Methods
by karlgoethebier (Abbot) on Jun 07, 2015 at 20:06 UTC

    Now i get: identify: Insufficient image data in file `mandelbrot.bmp'.

    «The Crux of the Biscuit is the Apostrophe»

      Hm. Both versions work with my image viewer. Can you make a copy of your image available to me in .gd & the converted format? Or attach them to an email to me?

      Are you using truecolor images?


      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority". I'm with torvalds on this
      In the absence of evidence, opinion is indistinguishable from prejudice. Agile (and TDD) debunked

        Do'h! Know it works. GD::Image->trueColor(1); did it.

        And convert mandelbrot.bmp mandelbrot.png works too.

        Thank you very much for advice and best regards, Karl

        P.S.: If you can effort the time it would be very nice to get some explanations about how your code works. I guess that only a few understand it just by inspection. Unfortunately i'm not one of the chosen. But i'm working on it ;-)

        «The Crux of the Biscuit is the Apostrophe»