Commit Graph

194 Commits

Author SHA1 Message Date
wiredfool
32e2f97b21 Tag issues with libtiff -- Need to parse the tuples for the ifd and the im.ifd. getattr + default for the im.ifd instead of silent try/except 2013-10-22 09:18:41 -07:00
Eric Soroos
3128a76495 MM and II 16 bit integer tiffs pack/write properly using libtiff on bigendian platform 2013-10-21 22:37:20 +00:00
Eric Soroos
6f8d968cbb MM and II 16 bit integer tiffs unpack properly using libtiff on bigendian platform 2013-10-21 22:17:33 +00:00
wiredfool
7ece94edc7 compression in encoder info 2013-10-21 09:30:06 -07:00
wiredfool
08347569b5 Another python 2.6 detail 2013-10-08 11:32:51 -07:00
wiredfool
e9b0b09b72 Python 2.6 compatibility 2013-10-08 10:43:55 -07:00
wiredfool
a91283061e Python3 fixes 2013-10-07 23:30:55 -07:00
wiredfool
e35ed87be6 Writing multiple rational items 2013-10-07 23:09:41 -07:00
wiredfool
0204733fd6 Proper handling of both IFDs for libtiff usage 2013-10-07 23:03:50 -07:00
wiredfool
2188cf2baf typo 2013-10-07 23:03:13 -07:00
wiredfool
e6c8e5abec better handling of unicode, rational tuples 2013-10-07 23:02:59 -07:00
wiredfool
951a5d4ce8 Using the public interface rather than the raw, undecoded interface 2013-10-07 17:05:27 -07:00
wiredfool
ce0e8b6abf streamlining internal representation of types in ImageFileDirectory 2013-10-07 17:05:27 -07:00
wiredfool
c4f9fa7a40 Py3 -- can't join a string 2013-10-02 22:23:27 -07:00
wiredfool
dbf47837ce Add arbitrary tags to tiff images using an ImageFileDirectory 2013-10-02 22:06:17 -07:00
wiredfool
bb9672095b initial working version of saving arbitrary tags from the img.tags directory 2013-09-28 21:31:32 -07:00
wiredfool
465ebd3af3 added tagnames for ImageJ tiff tags 2013-09-27 10:41:27 -07:00
wiredfool
a40950c3b9 Properly set the mode for files with rawmode of F;32BF 2013-09-27 10:41:03 -07:00
Eric Buehl
26fb0eadad issue warning instead of debug/print 2013-08-20 16:53:55 +00:00
Eric Buehl
7430dc261f be more tolerant of tag read failures
this can occur if the MakerNote has a pointer to outside the EXIF block
2013-08-19 22:51:50 +00:00
wiredfool
db49dbf9de Ignore fillorder=2 when reading using libtiff 2013-07-10 22:36:55 -07:00
Alexey Buzanov
a130c45990 add several TIFF decoders and encoders 2013-07-01 18:45:42 +04:00
Matti Picus
af94b45cbc allow integer image resolution as well as rational 2013-05-07 23:33:21 +03:00
Matti Picus
5ca04bb728 a test that fails for images with integer resolution 2013-05-07 23:23:51 +03:00
wiredfool
1540d46ca9 support for the differences between StringIO and BytesIO 2013-03-14 10:36:15 -07:00
Christoph Gohlke
dbfaff5673 Support uint32 TIFF 2013-03-13 21:08:24 -07:00
Christoph Gohlke
a26d7b6261 Decode bytestr instead of str 2013-03-13 19:18:40 -07:00
wiredfool
a3b4697965 typo 2013-03-11 22:04:34 -07:00
wiredfool
4f2a1f9715 () for print, since we're using print_statement 2013-03-08 21:15:22 -08:00
wiredfool
5ba6564e26 initial merge of wiredfool/Python-Imaging-Library-G4-Tiff-Support 2013-03-08 19:51:59 -08:00
Alex Clark
3020c16eaa Fix imports 2013-03-07 11:20:28 -05:00
Alex Clark
f29950bc6d Fix typo 2013-03-07 08:52:44 -05:00
Phil Elson
603f2a226f Added the `named` method to a Tiffs tag getter. 2013-03-07 12:00:19 +00:00
Mikhail Korobov
a71183dab5 better fix for #15 (with a test case now) 2013-02-26 17:12:11 +06:00
Brian Crowell
a7e3b2e47b py3k: The big push
There are two main issues fixed with this commit:

* bytes vs. str: All file, image, and palette data are now handled as
  bytes. A new _binary module consolidates the hacks needed to do this
  across Python versions. tostring/fromstring methods have been renamed to
  tobytes/frombytes, but the Python 2.6/2.7 versions alias them to the old
  names for compatibility. Users should move to tobytes/frombytes.

  One other potentially-breaking change is that text data in image files
  (such as tags, comments) are now explicitly handled with a specific
  character encoding in mind. This works well with the Unicode str in
  Python 3, but may trip up old code expecting a straight byte-for-byte
  translation to a Python string. This also required a change to Gohlke's
  tags tests (in Tests/test_file_png.py) to expect Unicode strings from
  the code.

* True div vs. floor div: Many division operations used the "/" operator
  to do floor division, which is now the "//" operator in Python 3. These
  were fixed.

As of this commit, on the first pass, I have one failing test (improper
handling of a slice object in a C module, test_imagepath.py) in Python 3,
and three that that I haven't tried running yet (test_imagegl,
test_imagegrab, and test_imageqt). I also haven't tested anything on
Windows. All but the three skipped tests run flawlessly against Pythons
2.6 and 2.7.
2013-01-10 08:46:56 -06:00
Brian Crowell
31c454b925 py3k: 2to3's "idiom" filter
This is, I guess, a few things the Python devs were just fed up with.

* "while 1" is now "while True"
* Types are compared with isinstance instead of ==
* Sort a list in one go with sorted()

My own twist is to also replace type('') with str, type(()) with tuple,
type([]) with list, type(1) with int, and type(5000.0) with float.
2013-01-10 08:46:53 -06:00
Brian Crowell
83ff0b3b31 py3k: Use relative imports
In py3k, imports are absolute unless using the "from . import" syntax.

This commit also solves a recursive import between Image, ImageColor, and
ImagePalette by delay-importing ImagePalette in Image.

I'm not too keen on this commit because the syntax is ugly. I might go back
and prefer the prettier "from PIL import".
2013-01-10 08:46:48 -06:00
Brian Crowell
5076c35cc5 py3k: print is a function
Seriously, if you didn't know that, you've been in a freaking cave, man.
2013-01-10 08:46:46 -06:00
Brian Crowell
fc035814bd py3k: map and filter to list comprehensions
What's really going on is that map() and filter() return iterators in py3k.
I've just gone ahead and turned them all into list comprehensions, because
I find them much easier to read.
2013-01-10 08:46:43 -06:00
Brian Crowell
e514912378 py3k: Rewrite dictionary support for Tiff ImageFileDictionary
This commit brings in the collections.MutableMapping mixin to provide full
dictionary support for ImageFileDictionary.
2013-01-10 08:46:43 -06:00
Brian Crowell
09f1081c95 py3k: Fix up uses of dictionary views, ranges, and has_key()
y.has_key(x) is gone (use x in y), and keys(), values(), items(), and
range() all return views.

Some iterables needed to be packed into lists, either because the code
expected a list (such as "range(256) * 3") or because the original
collection was being modified (automatic global declarations).

The Tiff ImageFileDictionary is a special case and will be dealt with in
another commit.
2013-01-10 08:46:42 -06:00
Brian Crowell
78575798d7 py3k: Update exception usage to modern syntax 2013-01-10 08:46:33 -06:00
Brian Crowell
37f22ebfcd py3k: Use string methods instead of string module
First, we go for the obvious stuff. The string module methods are gone in
3.0, so we translate them to the appropriate methods on the string class.
2013-01-10 08:42:49 -06:00
Alex Clark
9a640e3157 Forking PIL 2010-07-30 22:52:47 -04:00