Skip to content

Commit

Permalink
filetype for binarytext is now a variable for image width, return "Un…
Browse files Browse the repository at this point in the history
…defined" for the type name no matter the value
  • Loading branch information
bricas committed Mar 23, 2014
1 parent 263ec0e commit 83b88d6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/Image/TextMode/SAUCE.pm
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ my $filetypes = {
},
Character => {
filetypes =>
[ qw( ASCII ANSi ANSiMation RIP PCBoard Avatar HTML Source ) ],
[ qw( ASCII ANSi ANSiMation RIP PCBoard Avatar HTML Source TundraDraw ) ],
flags => [ 'None', 'iCE Color' ],
tinfo => [
( { tinfo1 => 'Width', tinfo2 => 'Height' } ) x 3,
Expand Down Expand Up @@ -308,6 +308,11 @@ The string name of the data represented in filetype_id.
=cut

sub filetype {
# Filetype for "BinaryText" (id: 5) is used to encode the image width
if( $_[ 0 ]->datatype_id == 5 ) {
return 'Undefined';
}

return $filetypes->{ $_[ 0 ]->datatype }->{ filetypes }
->[ $_[ 0 ]->filetype_id || 0 ];
}
Expand Down

0 comments on commit 83b88d6

Please sign in to comment.