Commit Graph

11075 Commits

Author SHA1 Message Date
hugovk
0b79c6e24a Remove unreachable code (if 0) 2015-03-05 21:07:16 +02:00
artscoop
8c003e9b3f And finally ?
Error happening in Python 3.x with P images:
in original code, palette data was created from a list of bytestrings. Changed to a full bytestring.
- `b"".join(list of bytestrings)` works in python 2.7 and 3.x
- `b"".join(bytestring)` works in python 2.7 but fails in python 3.x
No need to `join` anymore. Works in 3.x
2015-03-05 12:17:52 +01:00
artscoop
310684521a Update BmpImagePlugin.py
Fails on Python 3, tried some fixes before going the virtualenv3 route
2015-03-05 11:32:03 +01:00
artscoop
514c55aa16 Test fix for supported 32bit RGBA .cur file
Some .cur file with alpha was loaded fully opaque with PIL. Fixed, and fixed the test to take that into account.
2015-03-05 10:55:32 +01:00
artscoop
613d22fc75 Removed debug print
Again.
2015-03-05 10:44:54 +01:00
artscoop
9e3af5a161 Fix .cur 32/rgba, offsets etc.
Various fixes on code broken or not passing tests
2015-03-05 10:40:10 +01:00
artscoop
d7a78f3813 Fixing .cur special header offset
use offset provided
2015-03-05 09:02:09 +01:00
artscoop
82aa9011c9 Restored original error messages
I suspect the tests to check against an exact string when expecting an error
2015-03-05 08:47:34 +01:00
artscoop
c8fddb19f5 Update BmpImagePlugin.py
Getting bonkers but I need to know
2015-03-05 08:34:01 +01:00
artscoop
934651427d Use 1 and not P for basic 1bpp BMP
Readapted some original code.
2015-03-05 08:19:14 +01:00
artscoop
56439b728f Test with original code
...
2015-03-04 23:06:21 +01:00
artscoop
f953b98285 Try to fix tests
Choked on roundtrip, where a P;1 image was returned instead of a 1 image.
2015-03-04 22:40:04 +01:00
artscoop
7b657f6887 Fix for all good_tests
Fixed loading of all types of provided images (+rgba). Added edge case where the header is reported as 40 bytes long with BITFIELDS (they start past the 40 bytes of the header). Loading fails for RLE, but IIRC, they're unsupported so it's normal.
2015-03-04 22:05:32 +01:00
artscoop
c8551770eb Quickfix number 4
Until tests pass.
2015-03-04 19:55:08 +01:00
artscoop
497ddf9c68 Remember correct image offset if bitfields+palette
Use the provided image offset if there is palette data while the image is bitfielded.
2015-03-04 19:50:52 +01:00
artscoop
877c138e21 1bpp BMP fix
It appears that
{{{
  The handling of 1bpp bitmaps is a little complicated.
  When reading 1bpp bitmaps, the palette is ignored.
  1's are considered foreground, and they are considered black.
  0's are considered background, and they are considered white.
}}}
so the raw mode has to be `1;I`
2015-03-04 19:26:15 +01:00
artscoop
c0ce8d0ae8 Removed debug print
Debug print left in _save. Removed.
2015-03-04 18:29:28 +01:00
artscoop
456bd96565 Fix 32-bit BMP loading (RGBA or RGBX)
PIL choked on perfectly valid BMP files (32 bits with Alpha). It could not handle valid RGBA masks to determine the raw format.
To clarify things, I:
- Rewrote the `BmpImagePlugin.BmpImageFile` class to be far more readable
- Made error messages more explicit (e.g. say that RLE bitmaps are unsupported)
- Made a readable dict to contain BMP header information
- Kept the existing security checks
- Instead of reading palette info by chunks of 3/4 bytes, read the whole palette info at once and parse the data.
- Now works with BMPv4/5 with Alpha (and can be exported to alpha PNG for example)
- Tested load and save with RGB24, RGB8, RGB8L, RGB32 and RGBA32.
- Tested with one bogus file. File not accepted, as expected.

I wanted to test more BMP formats, but I could not find that many images.
But for all the types I tested, it worked flawlessly.
2015-03-04 18:15:56 +01:00
Andrew Murray
7a798f8724 Added copy method font_variant() and accessible properties to truetype() 2015-03-04 00:00:18 +11:00
Hugo
2c70c9e5e9 Update CHANGES.rst [CI skip] 2015-03-02 10:45:33 +02:00
Hugo
061c9f41d8 Merge pull request #1121 from radarhere/endian
Let Python do the endian stuff + tests
2015-03-02 10:43:27 +02:00
Hugo
07f67f330e Merge pull request #1120 from radarhere/patch-1
Fixed typo in Tests README.rst
2015-03-02 10:36:34 +02:00
Andrew Murray
f644adbb05 Fixed binary conversion bug, and added corresponding tests 2015-03-02 09:56:47 +11:00
Andrew Murray
ef6f30b674 Fixed typo in Tests README.rst 2015-03-02 09:28:24 +11:00
amoibos
aeb1e61aa7 let python do the endian stuff 2015-03-02 00:16:13 +11:00
wiredfool
9eefe4a7ba Update CHANGES.rst [ci skip] 2015-02-25 10:09:32 -08:00
wiredfool
51eb8b6237 Merge pull request #1114 from benoit-pierre/fix-webp-memory-leak
Fix WebP memory leaks
2015-02-25 10:08:01 -08:00
wiredfool
7badc01426 Merge pull request #1116 from GotenXiao/fix-truetype-documentation
Fix truetype() documentation
2015-02-23 22:01:15 -08:00
Robin Lewis
7fafd09bf5 Document filename parameter as deprecated in truetype() 2015-02-23 12:23:01 +00:00
Robin Lewis
066faeb211 Reference non-deprecated argument in truetype documentation 2015-02-23 12:00:52 +00:00
Björn Pedersen
47f5c9e650 Fix float precission 2015-02-23 12:11:20 +01:00
Björn Pedersen
e8553e1dae Tiff float tags: Use first val in tuple 2015-02-23 12:06:29 +01:00
Björn Pedersen
0238a80e24 Fix test failure on float
due to rounding, the values are just 'almost' equal.
2015-02-23 11:19:32 +01:00
Benoit Pierre
76bafe20a6 webp: better error checking when using Mux API 2015-02-23 11:10:37 +01:00
Benoit Pierre
fef9c7001d webp: fix memory leak when using Mux API 2015-02-23 11:10:37 +01:00
Benoit Pierre
4930b66aa9 webp: fix memory leak
The "S" format specifier for Py_BuildValue *increases* the object
reference count.
2015-02-23 11:10:37 +01:00
Benoit Pierre
3d5dd3b4fc webp: minor cleanup 2015-02-23 11:10:37 +01:00
Benoit Pierre
4af381c6ba webp: add memory leak test 2015-02-23 11:10:37 +01:00
Björn Pedersen
1f11fc7be5 Fix typo in test 2015-02-23 11:09:01 +01:00
Björn Pedersen
31be9f12ad Add tests for tiff float tag values
Add tests for writing of float/double values in tiff file tags.
2015-02-23 10:52:27 +01:00
Björn Pedersen
61fb1c5bd4 Tiff: allow writing floating poitn tag values
Use the inverse logic used for loading floating point tag
values to also write them out again.
2015-02-23 09:46:35 +01:00
wiredfool
0bc24cb213 Merge pull request #1110 from radarhere/master
Early webp versions are more lossy.
2015-02-14 12:24:00 -08:00
Hans-Peter Jansen
be30160d57 early versions of webp are known to produce higher deviations: deal with it 2015-02-14 23:50:25 +11:00
Chris Adams
5ec6fcdeaa Tidy docs for DecompressionBombWarning
* Fix formatting to display simplefilter examples as code blocks rather
  than italics
* Wrap text so it's not one incredibly long line
2015-02-10 13:15:47 -05:00
wiredfool
43830273a5 Merge pull request #1106 from hugovk/test_tiff_dict
Fix TIFF test for PyPy 2.5.0
2015-02-09 11:32:34 -08:00
hugovk
d12acfee84 Test as_dict() directly instead of as string. Fix for PyPy. 2015-02-08 19:09:39 +02:00
wiredfool
8c88a4d8d3 Update CHANGES.rst [ci skip] 2015-02-05 22:34:13 -08:00
wiredfool
b384a7f992 Merge pull request #1088 from bgilbert/opaque-RGBa
Fast path for opaque pixels in RGBa unpacker
2015-02-05 22:32:58 -08:00
wiredfool
cfbb2b3618 Update CHANGES.rst [ci skip] 2015-02-05 22:29:48 -08:00
wiredfool
66c3d2f6b0 Merge pull request #1096 from immerrr/rgba-premultiplied-codecs
Enable basic support for 'RGBa' raw encoding/decoding
2015-02-05 22:28:51 -08:00