public class ImageUtil extends Object
Modifier and Type | Method and Description |
---|---|
URL |
getTarget()
Returns the URL of the target.
|
boolean |
isJPEG(String jpegBase,
URL parentURL)
Check if a JPEG file is valid by inspecting the first 2 bytes for 0xffd8 and last 2 bytes for 0xffd9.
|
boolean |
isPNG(String pngBase,
URL parentURL)
Check if a PNG file is valid by inspecting if the 1st group 4 bytes are 0x89504e47 and the 2nd group of 4 bytes are 0x0d0a1a0a
|
public ImageUtil(URL target)
public URL getTarget()
public boolean isJPEG(String jpegBase, URL parentURL) throws Exception
jpegBase
- The basename of the JPEG fileparentURL
- The URL of the parent of basenameException
public boolean isPNG(String pngBase, URL parentURL) throws Exception
pngBase
- The basename of the PNG fileparentURL
- The URL of the parent of basenameException
Copyright © 2022 Jet Propulsion Laboratory, California Institute of Technology. All rights reserved.