|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectar.com.hjg.pngj.chunks.PngMetadata
public class PngMetadata
We consider "image metadata" every info inside the image except for the most basic image info (IHDR chunk - ImageInfo class) and the pixels values.
This includes the palette (if present) and all the ancillary chunks
This class provides a wrapper over the collection of chunks of a image (read or to write) and provides some high level methods to access them
Constructor Summary | |
---|---|
PngMetadata(ChunksList chunks)
|
Method Summary | |
---|---|
double[] |
getDpi()
returns -1 if not found or dimension unknown |
PngChunkTIME |
getTime()
null if not found |
String |
getTimeAsString()
|
String |
getTxtForKey(String k)
Returns empty if not found, concatenated (with newlines) if multiple! |
List<? extends PngChunkTextVar> |
getTxtsForKey(String k)
gets all text chunks with a given key returns null if not found Warning: this does not check the "lang" key of iTxt |
void |
queueChunk(PngChunk c)
|
void |
queueChunk(PngChunk c,
boolean lazyOverwrite)
Queues the chunk at the writer lazyOverwrite: if true, checks if there is a queued "equivalent" chunk and if so, overwrites it. |
void |
setDpi(double x)
|
void |
setDpi(double x,
double y)
|
PngChunkTextVar |
setText(String k,
String val)
|
PngChunkTextVar |
setText(String k,
String val,
boolean useLatin1,
boolean compress)
Creates a text chunk and queue it. |
PngChunkTIME |
setTimeNow()
|
PngChunkTIME |
setTimeNow(int secsAgo)
Creates a time chunk with current time, less secsAgo seconds |
PngChunkTIME |
setTimeYMDHMS(int yearx,
int monx,
int dayx,
int hourx,
int minx,
int secx)
Creates a time chunk with diven date-time |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PngMetadata(ChunksList chunks)
Method Detail |
---|
public double[] getDpi()
public PngChunkTIME getTime()
public String getTimeAsString()
public String getTxtForKey(String k)
Use getTxtsForKey() if you don't want this behaviour
public List<? extends PngChunkTextVar> getTxtsForKey(String k)
returns null if not found
Warning: this does not check the "lang" key of iTxt
public void queueChunk(PngChunk c)
public void queueChunk(PngChunk c, boolean lazyOverwrite)
lazyOverwrite: if true, checks if there is a queued "equivalent" chunk and if so, overwrites it. However if that not check for already written chunks.
public void setDpi(double x)
public void setDpi(double x, double y)
public PngChunkTextVar setText(String k, String val)
public PngChunkTextVar setText(String k, String val, boolean useLatin1, boolean compress)
k
- : key (latin1)val
- (arbitrary, should be latin1 if useLatin1)useLatin1
- compress
-
public PngChunkTIME setTimeNow()
public PngChunkTIME setTimeNow(int secsAgo)
public PngChunkTIME setTimeYMDHMS(int yearx, int monx, int dayx, int hourx, int minx, int secx)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |