What are all the binary stuff I get from Perl Image :: Info :: image_info ()?

I am getting the following output after running the code for the image

[1459]./image_info.pl lah.png 
$VAR1 = {
          'width' => 206,          'file_media_type' => 'image/png',
          'file_ext' => 'png',
          'PNG_Chunks' => [
                            'IHDR',
?V?????O?H??^#?C&?fu?M?5V??m6???M?s',
                            'IEND' 9   :˺??:?E??(;t??[/????o?4?4?O??TܲD
#PJ?EHͨ??ƥ8???#u   ?t??1?I/=?!w"???)?,??????X?|?{                                              M?N??A?  V``?&?
{8.?"???I)?W?_??|k?.c??l??s?8?~^Z??????_;?,,+,/?4~]ů?ZìU?+???i?s`C}??/?_??>?d~?lrn?n^???2???z?-???B??n?D;??aXHoeh?3???
DA5?N?Aw??? ???J?-????P?> 'RGB',
C?~&?1?cd 'heiga~H.`ha162,         H2?I???P?p?HsZ?&?P? Y`??;?q4Kov??3?Z???L???? ?F??&???aq?H???????"Ri?F? ??ٵ???L  B??r??H%??@??٩qiLJ?pres??on' => 'Deflate',
        ??/?Z?w,?k???g?=> '2835 dpm',
          'Compression' ? ((~??_^A ?c?vV??w????m,7????Eb???0J5?? ??? ????9????:?,24m[1460]  

      

I don't understand the last bit of the file.

How do I change the encoding for reading?

+1


a source to share


3 answers


The Perl module Image::Info

shouldn't display all this encoded data at all. My own tests of this unit have never done this, for example:

$VAR1 = {
          'width' => 58,
          'file_media_type' => 'image/png',
          'file_ext' => 'png',
          'PNG_Chunks' => [
                            'IHDR',
                            'IDAT',
                            'IEND'
                          ],
          'PNG_Filter' => 'Adaptive',
          'color_type' => 'Gray',
          'height' => 56,
          'SampleFormat' => 'U8',
          'Compression' => 'Deflate',
          'resolution' => '1/1'
        };

      



Try on another PNG file, it looks like it might be corrupted.

+4


a source


You are showing the binary as text. It will not be readable in any encoding.



+1


a source


Redirect the output of your script to a file:

./image_info.pl lah.png >log.txt 2>&1

      

Then open log.txt

in your favorite GUI text editor (like kate, gedit, notepad ++) by specifying ISO-8859-1 or UTF-8 in the open dialog. Try both encodings.

0


a source







All Articles