Method Image.JPEG.decode_header()
- Method
decode
Method _decode
Method decode_header
objectdecode(stringdata)
objectdecode(stringdata,mappingoptions)
mapping_decode(stringdata)
mapping_decode(stringdata,mappingoptions)
mappingdecode_header(stringdata)- Description
Decodes a JPEG image. The simple decode function simply gives the image object, the other functions gives a mapping of information (see below).
The options argument may be a mapping containing zero or more decoding options:
"block_smoothing":boolDo interblock smoothing. Default is on (1).
"fancy_upsampling":boolDo fancy upsampling of chroma components. Default is on (1).
"method":intDCT method to use. Any of IFAST, ISLOW, FLOAT, DEFAULT or FASTEST. DEFAULT and FASTEST is from the jpeg library, probably ISLOW and IFAST respective.
"scale_num":int(1..)Rescale the image when read from JPEG data. My (Mirar) version (6a) of jpeglib can only handle 1/1, 1/2, 1/4 and 1/8.
"scale_denom":int(1..)_decode and decode_header gives a mapping as result, with this content:
"comment":stringComment marker of JPEG file, if present.
"xsize":intSize of image
"ysize":int"xdpi":floatImage dpi, if known.
"ydpi":float"type":stringFile type information as MIME type. Always "image/jpeg".
"num_compontents":intNumber of channels in JPEG image.
"color_space":stringColor space of JPEG image. Any of "GRAYSCALE", "RGB", "YUV", "CMYK", "YCCK" or "UNKNOWN".
"density_unit":int(0..2)The unit used for x_density and y_density.
0No unit
1dpi
2dpcm
"x_density":intDensity of image.
"y_density":int"adobe_marker":boolIf the file has an Adobe marker.
"quant_tables":mapping(int:array(array(int)))JPEG quant tables.
"quality":int(0..100)JPEG quality guess.
"marker":mapping(int(8bit):string(8bit)|array(string(8bit)))Mapping from application and comment markers to their values.