mirror of
https://github.com/dmolony/DiskBrowser.git
synced 2024-11-26 23:51:57 +00:00
some BMP
This commit is contained in:
parent
195a4af674
commit
df118b4709
@ -55,7 +55,7 @@ public abstract class HiResImage extends AbstractFile
|
||||
|
||||
protected void createImage ()
|
||||
{
|
||||
if (isGif (buffer) || isPng (buffer))
|
||||
if (isGif (buffer) || isPng (buffer) || isBmp (buffer))
|
||||
makeImage ();
|
||||
else if (monochrome)
|
||||
createMonochromeImage ();
|
||||
@ -287,6 +287,11 @@ public abstract class HiResImage extends AbstractFile
|
||||
{
|
||||
e.printStackTrace ();
|
||||
}
|
||||
catch (IndexOutOfBoundsException e) // some BMP files cause this
|
||||
{
|
||||
System.out.println ("Error in makeImage()");
|
||||
System.out.println (e.getMessage ());
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isGif (byte[] buffer)
|
||||
@ -310,6 +315,15 @@ public abstract class HiResImage extends AbstractFile
|
||||
return true;
|
||||
}
|
||||
|
||||
public static boolean isBmp (byte[] buffer)
|
||||
{
|
||||
if (buffer.length < 2)
|
||||
return false;
|
||||
|
||||
String text = new String (buffer, 0, 2);
|
||||
return text.equals ("BM");
|
||||
}
|
||||
|
||||
public static PaletteFactory getPaletteFactory ()
|
||||
{
|
||||
return paletteFactory;
|
||||
|
@ -270,7 +270,9 @@ class FileEntry extends CatalogEntry implements ProdosConstants
|
||||
file = new ShapeTable (name, exactBuffer);
|
||||
else if (SimpleText.isHTML (exactBuffer))
|
||||
file = new SimpleText (name, exactBuffer);
|
||||
else if (HiResImage.isGif (exactBuffer))
|
||||
else if (HiResImage.isGif (exactBuffer) || HiResImage.isPng (exactBuffer))
|
||||
file = new OriginalHiResImage (name, exactBuffer, auxType);
|
||||
else if (name.endsWith (".BMP") && HiResImage.isBmp (exactBuffer))
|
||||
file = new OriginalHiResImage (name, exactBuffer, auxType);
|
||||
else if (link != null)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user