PIL image size after rotate

Chad Ferguson <[email protected]> Sat, 10 Nov 2012 23:01:14 -0500
Newsgroups gmane.comp.python.image
Message-ID <[email protected]>
This is a multi-part message in MIME format.
--------------050501040904070302020803
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Listers,

I have a very simple script that rotates images using PIL.  After 
running, the output images are about 1/3 the file size of the input 
image.  The file attributes indicate they have increased in resolution 
from 72 to 96 ppi but have the same radiometric depth. Does the PIL 
rotate method apply a hidden resampling? Why are the output images so 
much smaller?

from PIL import Image
import glob, os

indir = r'C:\Users\Me\Pictures\export'
for infile in glob.glob(indir + '\\' + "*.jpg"):
     print infile
     file, ext = os.path.splitext(infile)
     im = Image.open(infile)
     im2 = im.rotate(270)
     im2.save(file +"_rotate.jpg", "JPEG")
    #  os.remove(infile)

--------------050501040904070302020803
Content-Type: text/x-vcard; charset=utf-8;
 name="terrafergus.vcf"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="terrafergus.vcf"

begin:vcard
fn:Chad
n:;Chad
version:2.1
end:vcard


--------------050501040904070302020803
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Image-SIG maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/image-sig

--------------050501040904070302020803--