Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed3a.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.022 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; '128': 0.09; 'bytes.': 0.09; 'pixels': 0.09; 'rows': 0.09; 'way:': 0.09; 'cc:addr:python- list': 0.11; 'expects': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'mode,': 0.16; 'rotation': 0.16; 'subject:issue': 0.16; 'wrote:': 0.18; 'library': 0.18; 'cc:addr:python.org': 0.22; '31,': 0.24; 'bytes': 0.24; 'documented': 0.24; 'cc:2**0': 0.24; 'this:': 0.26; 'header:In- Reply-To:1': 0.27; 'function': 0.29; 'am,': 0.29; 'message- id:@mail.gmail.com': 0.30; 'you?': 0.31; 'handled': 0.32; 'cases': 0.33; 'device': 0.34; "i'd": 0.34; 'received:google.com': 0.35; 'i.e.': 0.36; 'doing': 0.36; 'url:org': 0.36; 'being': 0.38; 'black': 0.61; 'mar': 0.68; '2015': 0.84; '270': 0.84; 'portrait': 0.84; 'url:reference': 0.84; 'url:image': 0.91; 'url:latest': 0.91; 'to:none': 0.92 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=rN9clKjCv3/UI8kR90W+3FYNgroV1Q8w7nw9+Io9tTs=; b=MsOlwB4Y/P/WA2YVWSQb7ld+3nJknps3Pb+FnchDMU8SxByZso67OM4wouN5qHx3m+ SLwVyDbQiEaFopcRDcH1gAxAmH3yTK/sIJynKDbchBeDoMTHbSy/oqOEWf8A7PYMr+u/ d1zyQfEXuRi4/SOiqyUkiSemEDxoM4PodClk8tuOUup0DrWtRDHKFfKzTnVqeK3HG6Bc TsGEVFR0r8KAFr+eKBB/TRAvUrnx0MAUNrZ7/lq8tDfb922WzY6BZY/oHWg7a/l3A/C5 PHY5GYtuSrpfbCdrJFVUKJVu8NmweWPClLGv9kRcAZ5NhThJs1GrSJPRcphnniOukkd+ yVmQ== MIME-Version: 1.0 X-Received: by 10.43.38.144 with SMTP id ti16mr64034292icb.26.1427759273820; Mon, 30 Mar 2015 16:47:53 -0700 (PDT) In-Reply-To: References: Date: Tue, 31 Mar 2015 10:47:53 +1100 Subject: Re: Image rotation issue From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.19 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 20 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1427759276 news.xs4all.nl 2860 [2001:888:2000:d::a6]:58598 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:88355 On Tue, Mar 31, 2015 at 8:22 AM, wrote: > rotimg = img.rotate(270) # rotation is counterclockwise Unless the 90 and 270 cases are documented as being handled specially, I'd look for a dedicated function for doing those changes. A quick perusal of the docs showed up this: http://pillow.readthedocs.org/en/latest/reference/Image.html#PIL.Image.Image.transpose Is that any better, or is that doing the exact same thing as rotate()? By the way: > The black & white only device (1024 (X) x 1280 (Y)) expects the compressed data based on portrait mode, i.e. 8 pixels combined into one bytes for 1280 rows of 128 bytes. > This sounds to me like the fax standard. I wonder, can you make use of a TIFF library to do some of your work for you? ChrisA