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 ()
|
protected void createImage ()
|
||||||
{
|
{
|
||||||
if (isGif (buffer) || isPng (buffer))
|
if (isGif (buffer) || isPng (buffer) || isBmp (buffer))
|
||||||
makeImage ();
|
makeImage ();
|
||||||
else if (monochrome)
|
else if (monochrome)
|
||||||
createMonochromeImage ();
|
createMonochromeImage ();
|
||||||
@ -287,6 +287,11 @@ public abstract class HiResImage extends AbstractFile
|
|||||||
{
|
{
|
||||||
e.printStackTrace ();
|
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)
|
public static boolean isGif (byte[] buffer)
|
||||||
@ -310,6 +315,15 @@ public abstract class HiResImage extends AbstractFile
|
|||||||
return true;
|
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 ()
|
public static PaletteFactory getPaletteFactory ()
|
||||||
{
|
{
|
||||||
return paletteFactory;
|
return paletteFactory;
|
||||||
|
@ -270,7 +270,9 @@ class FileEntry extends CatalogEntry implements ProdosConstants
|
|||||||
file = new ShapeTable (name, exactBuffer);
|
file = new ShapeTable (name, exactBuffer);
|
||||||
else if (SimpleText.isHTML (exactBuffer))
|
else if (SimpleText.isHTML (exactBuffer))
|
||||||
file = new SimpleText (name, 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);
|
file = new OriginalHiResImage (name, exactBuffer, auxType);
|
||||||
else if (link != null)
|
else if (link != null)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user