Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion Graph.pm
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,8 @@ sub _read_logo_file
pack("H8",'ffd8ffe0') => "jpeg",
'GIF8' => "gif",
'.PNG' => "png",
'/* X'=> "xpm", # technically '/* XPM */', but I'm hashing, here
'/* X' => "xpm", # technically '/* XPM */', but I'm hashing, here
'#def' => "xbm",
);
if (my $match = $magic{ substr $logodata, 0, 4 }) {
push @tried, $match;
Expand All @@ -362,6 +363,9 @@ sub _read_logo_file
$glogo = GD::Image->$gdimport(\*LOGO);
}
}
} elsif ($logo_path =~ /_xbm_/) { # no magic possible for xbm
push @tried, 'xbm';
$glogo = GD::Image->newFromXbm($logo_path);
# should this actually be "if (!$glogo), rather than an else?
} else { # Hail Mary, full of Grace! Blessed art thou among women...
push @tried, 'libgd best-guess';
Expand Down
8 changes: 8 additions & 0 deletions t/images/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#include <stdio.h>
#include "logo_xbm_noext.c"

void main() {
FILE *f = fopen ("logo_xbm_noext", "w");
fwrite (logo_bits, sizeof(logo_bits), 1, f);
fclose (f);
}