in reply to About GD Image Data Output Methods [SOLVED]
Karl, try using this to convert the internal gd format to a Windows .BMP format. After that, any of your image converters should be able to port it to whatever format you require.
# ... $image is your GD::Image for output my $gd = $image->gd; my @attrs = 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, $attrs[1], $attrs[2], 1, 24, $len, 0, +0, 0, 0; $bmp .= join'', unpack '(xaaa)*', $gd; ## Now print $bmp to a file xxx.bmp and convert; or maybe pipe directl +y to an image converter for conversion.
It's a bit "magic number" ladened, but that's all they are; magic numbers.
Yell, if you really need the explanation :)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: About GD Image Data Output Methods
by karlgoethebier (Abbot) on Jun 07, 2015 at 19:01 UTC | |
by BrowserUk (Patriarch) on Jun 07, 2015 at 19:33 UTC | |
by karlgoethebier (Abbot) on Jun 07, 2015 at 20:06 UTC | |
by BrowserUk (Patriarch) on Jun 07, 2015 at 20:13 UTC | |
by karlgoethebier (Abbot) on Jun 07, 2015 at 21:01 UTC | |
|