Skip to content

Commit

Permalink
add IO::Pic support for XBM
Browse files Browse the repository at this point in the history
  • Loading branch information
mohawk2 committed Aug 8, 2024
1 parent adbb918 commit 17632cc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
- now an error to output to ndarray with inward but no backward dataflow (#485)
- now slices etc with dataflow turn off backward dataflow if any input has inward-only dataflow (#485)
- add GSL::RNG::ran_shuffle_1d
- add IO::Pic support for XBM

2.089_02 2024-06-26
- PDL::VectorValued::vcos into Primitive - thanks @moocow-the-bovine
Expand Down
5 changes: 4 additions & 1 deletion IO/Pnm/Pic.pm
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ sub init_converter_table {
['PS','pnmtops -dpi=100',
'pstopnm -stdout -xborder=0 -yborder=0 -quiet -dpi=100'],
['GIF','ppmtogif','giftopnm'],
['XBM','pbmtoxbm','xbmtopbm'],
['IFF','ppmtoilbm','ilbmtoppm']
);
push(@special,['JPEG', 'cjpeg' ,'djpeg'])
Expand Down Expand Up @@ -786,7 +787,7 @@ sub PDL::wmpeg {
Figure out the format of an image file from its magic numbers, or else, from its extension.
Currently recognized image formats are: PNM, GIF, TIFF, JPEG, SGI,
RAST, IFF, PCX, PS, FITS, PNG. If the format can not be determined,
RAST, IFF, PCX, PS, FITS, PNG, XBM. If the format can not be determined,
the string 'UNKNOWN' is returned.
=for example
Expand Down Expand Up @@ -855,6 +856,7 @@ sub chkext {
return 'PS' if $ext =~ /^ps/;
return 'FITS' if $ext =~ /^f(i?ts|it)$/;
return 'PNG' if $ext =~ /^png$/i;
return 'XBM' if $ext =~ /^xbm$/i;
}


Expand Down Expand Up @@ -893,6 +895,7 @@ sub chkform {
return 'PS' if $magic =~ /%!\s*PS/;
return 'FITS' if $magic =~ /^SIMPLE \=/;
return 'PNG' if $magic =~ /^.PNG\r/;
return 'XBM' if $magic =~ /^#define\s+/;
return chkext(getext($file)); # then try extensions
}

Expand Down

0 comments on commit 17632cc

Please sign in to comment.