|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.hd.d.pg2k.svrCore.MIME.AbstractHandler
org.hd.d.pg2k.svrCore.MIME.AbstractImageHandler
org.hd.d.pg2k.svrCore.mediahandler.jpg
public final class jpg
Default handler for jpg file (MIME type image/jpeg).
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.hd.d.pg2k.svrCore.MIME.Handler |
|---|
Handler.ThumbnailParams |
| Field Summary | |
|---|---|
private static int |
EST_BYTES_PER_IMAGE_PIXEL_IN_MEMORY
Estimated (maximum) bytes per pixel of a decoded image in memory. |
private static int |
EXIF
Type of EXIF segment in JPEG. |
private static int |
FILE_OVERHEAD
Estimated JPEG overhead constant, ie what would a 0x0 JPEG file size be; non-negative. |
private static int |
IPTC
Type of IPTC segment in JPEG. |
private static int |
MAX_VALUE_CHARS
Longest value (chars) we will accept without discarding; strictly positive. |
private static int |
maxJPEGQuality
Max quality allowed in a JPEG montage or thumbnail. |
private static int |
minJPEGQuality
Min quality allowed in a JPEG montage or thumbnail. |
private static int |
normalThumbnailJPEGQuality
Normal/initial quality for a JPEG thumbnail. |
private static int |
TARGET_BPP
Target bits-per-pixel for thumbnail images; strictly positive. |
private static Handler.ThumbnailParams |
thumbnailParams
Gather together thumbnail parameters. |
| Fields inherited from interface org.hd.d.pg2k.svrCore.MIME.Handler |
|---|
TAG_NAME_METADATA_TOP |
| Constructor Summary | |
|---|---|
jpg()
|
|
| Method Summary | |
|---|---|
boolean |
canMakeThumbnails()
Returns true if this can make thumbnail/sample exhibits for this type. |
protected org.w3c.dom.Node |
extractSpecificImageMetaData(javax.imageio.metadata.IIOMetadata imageMetadata,
Name.ExhibitFull exhibitName)
Get specific (image) metadata for one particular image type; null if none. |
java.awt.Dimension |
get2DImageDimensions(java.io.InputStream is)
Get dimensions X and Y of a JPEG exhibit, else null if dimensions cannot be computed. |
ExhibitMIME.ExhibitTypeParameters |
getExhibitType()
Get internal type of ExhibitMIME type; never null. |
Handler.ThumbnailParams |
getThumbnailParams()
Get ThumbnailParameters for JPEG handler. |
| Methods inherited from class org.hd.d.pg2k.svrCore.MIME.AbstractImageHandler |
|---|
_getEncoder, _reduceColoursQualityThreshold, _trimMetadata, decodeImage, estimateWorkingMemoryToCreateThumbnails, getMetadata, makeImageBinary, makeSizeConstrainedEncodedImage, makeThumbnailImage, makeThumbnails, makeThumbnails |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final int TARGET_BPP
A value in the range 2--4 is probably good.
private static final int FILE_OVERHEAD
One byte less than a 1x1 white image produced by PSP7.
private static final int maxJPEGQuality
private static final int normalThumbnailJPEGQuality
A quality of 75% is the default for the JPEG encoder.
A value from 50--90 is probably good; 85 has worked well in the past.
private static final int minJPEGQuality
private static final int EST_BYTES_PER_IMAGE_PIXEL_IN_MEMORY
private static final Handler.ThumbnailParams thumbnailParams
private static final int EXIF
private static final int IPTC
private static final int MAX_VALUE_CHARS
| Constructor Detail |
|---|
public jpg()
| Method Detail |
|---|
public ExhibitMIME.ExhibitTypeParameters getExhibitType()
public java.awt.Dimension get2DImageDimensions(java.io.InputStream is)
throws java.io.IOException
This input stream must be of the correct type, eg the magic number already checked.
This does not close its input stream when done.
get2DImageDimensions in interface Handlerget2DImageDimensions in class AbstractImageHandleris - the exhibit as a binary data stream
java.io.IOException - in case of problems with corrupt data
(or a broken exhibit)public boolean canMakeThumbnails()
canMakeThumbnails in interface HandlercanMakeThumbnails in class AbstractImageHandlerpublic Handler.ThumbnailParams getThumbnailParams()
getThumbnailParams in interface HandlergetThumbnailParams in class AbstractHandler
protected org.w3c.dom.Node extractSpecificImageMetaData(javax.imageio.metadata.IIOMetadata imageMetadata,
Name.ExhibitFull exhibitName)
We trim and normalise values shown a little, and discard any huge values, since this data is intended for a human to read. If they need more detail then they can download the image and open it in a decent Photoshop-like app.
This may be a mix of stream and image/frame metadata.
extractSpecificImageMetaData in class AbstractImageHandlerimageMetadata - imageio portable metadata for this exhibit; never nullexhibitName - full exhibit name (primarily to help with debugging); never null
|
DHD Multimedia Gallery V1.57.21 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||