JpegImagePlugin (version 0.6)
index
/Library/Python/2.7/site-packages/PIL/JpegImagePlugin.py

# The Python Imaging Library.
# $Id$
#
# JPEG (JFIF) file handling
#
# See "Digital Compression and Coding of Continous-Tone Still Images,
# Part 1, Requirements and Guidelines" (CCITT T.81 / ISO 10918-1)
#
# History:
# 1995-09-09 fl   Created
# 1995-09-13 fl   Added full parser
# 1996-03-25 fl   Added hack to use the IJG command line utilities
# 1996-05-05 fl   Workaround Photoshop 2.5 CMYK polarity bug
# 1996-05-28 fl   Added draft support, JFIF version (0.1)
# 1996-12-30 fl   Added encoder options, added progression property (0.2)
# 1997-08-27 fl   Save mode 1 images as BW (0.3)
# 1998-07-12 fl   Added YCbCr to draft and save methods (0.4)
# 1998-10-19 fl   Don't hang on files using 16-bit DQT's (0.4.1)
# 2001-04-16 fl   Extract DPI settings from JFIF files (0.4.2)
# 2002-07-01 fl   Skip pad bytes before markers; identify Exif files (0.4.3)
# 2003-04-25 fl   Added experimental EXIF decoder (0.5)
# 2003-06-06 fl   Added experimental EXIF GPSinfo decoder
# 2003-09-13 fl   Extract COM markers
# 2009-09-06 fl   Added icc_profile support (from Florian Hoech)
# 2009-03-06 fl   Changed CMYK handling; always use Adobe polarity (0.6)
# 2009-03-08 fl   Added subsampling support (from Justin Huff).
#
# Copyright (c) 1997-2003 by Secret Labs AB.
# Copyright (c) 1995-1996 by Fredrik Lundh.
#
# See the README file for information on usage and redistribution.
#

 
Modules
       
Image
ImageFile
array
string
struct

 
Classes
       
ImageFile.ImageFile(Image.Image)
JpegImageFile

 
class JpegImageFile(ImageFile.ImageFile)
    
Method resolution order:
JpegImageFile
ImageFile.ImageFile
Image.Image

Methods defined here:
draft(self, mode, size)
load_djpeg(self)

Data and other attributes defined here:
format = 'JPEG'
format_description = 'JPEG (ISO 10918)'

Methods inherited from ImageFile.ImageFile:
__init__(self, fp=None, filename=None)
load(self)
Load image data based on tile list
load_end(self)
load_prepare(self)
verify(self)
Check file integrity

Methods inherited from Image.Image:
__getattr__(self, name)
__repr__(self)
convert(self, mode=None, data=None, dither=None, palette=0, colors=256)
Convert to other pixel format
copy(self)
Copy raster data
crop(self, box=None)
Crop region from image
filter(self, filter)
Apply environment filter to image
fromstring(self, data, decoder_name='raw', *args)
Load data to image from binary string
getbands(self)
Get band names
getbbox(self)
Get bounding box of actual data (non-zero pixels) in image
getcolors(self, maxcolors=256)
Get colors from image, up to given limit
getdata(self, band=None)
Get image data as sequence object.
getextrema(self)
Get min/max value
getim(self)
Get PyCObject pointer to internal image memory
getpalette(self)
Get palette contents.
getpixel(self, xy)
Get pixel value
getprojection(self)
Get projection to x and y axes
histogram(self, mask=None, extrema=None)
Take histogram of image
offset(self, xoffset, yoffset=None)
(deprecated) Offset image in horizontal and/or vertical direction
paste(self, im, box=None, mask=None)
Paste other image into region
point(self, lut, mode=None)
Map image through lookup table
putalpha(self, alpha)
Set alpha layer
putdata(self, data, scale=1.0, offset=0.0)
Put data from a sequence object into an image.
putpalette(self, data, rawmode='RGB')
Put palette data into an image.
putpixel(self, xy, value)
Set pixel value
quantize(self, colors=256, method=0, kmeans=0, palette=None)
resize(self, size, resample=0)
Resize image
rotate(self, angle, resample=0, expand=0)
Rotate image.  Angle given as degrees counter-clockwise.
save(self, fp, format=None, **params)
Save image to file or stream
seek(self, frame)
Seek to given frame in sequence file
show(self, title=None, command=None)
Display image (for debug purposes only)
split(self)
Split image into bands
tell(self)
Return current frame number
thumbnail(self, size, resample=0)
Create thumbnail representation (modifies image in place)
tobitmap(self, name='image')
Return image as an XBM bitmap
tostring(self, encoder_name='raw', *args)
Return image as a binary string
transform(self, size, method, data=None, resample=0, fill=1)
Transform image
transpose(self, method)
Transpose image (flip or rotate in 90 degree steps)

 
Functions
       
APP(self, marker)
COM(self, marker)
DQT(self, marker)
SOF(self, marker)
Skip(self, marker)
i16(c, o=0)
i32(c, o=0)

 
Data
        MARKER = {65472: ('SOF0', 'Baseline DCT', <function SOF>), 65473: ('SOF1', 'Extended Sequential DCT', <function SOF>), 65474: ('SOF2', 'Progressive DCT', <function SOF>), 65475: ('SOF3', 'Spatial lossless', <function SOF>), 65476: ('DHT', 'Define Huffman table', <function Skip>), 65477: ('SOF5', 'Differential sequential DCT', <function SOF>), 65478: ('SOF6', 'Differential progressive DCT', <function SOF>), 65479: ('SOF7', 'Differential spatial', <function SOF>), 65480: ('JPG', 'Extension', None), 65481: ('SOF9', 'Extended sequential DCT (AC)', <function SOF>), ...}
RAWMODE = {'1': 'L', 'CMYK': 'CMYK;I', 'L': 'L', 'RGB': 'RGB', 'RGBA': 'RGB', 'RGBX': 'RGB', 'YCbCr': 'YCbCr'}
__version__ = '0.6'