-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Description
"illu10_no_preview.eps", "illu10_preview.eps", "illuCS6_no_preview.eps", and "illuCS6_preview.eps" all contain one line that is longer than 255 characters, which is the maximum limit according to the specification.
Page 13:
EPS files must not have lines of ASCII text that exceed 255 characters, excluding line-termination characters.
Page 25:
The hexadecimal lines must never exceed 255 bytes in length. In cases where the preview is very wide, the lines must be broken. The line breaks can be made at any even number of hex digits, because the dimensions of the finished preview are established by the width, height, and depth values.
The four image files appear to be nearly the same, and have the same long line:
Pillow/Tests/images/illu10_no_preview.eps
Line 7995 in 50f7888
| <xmpGImg:image>/9j/4AAQSkZJRgABAgEASABIAAD/7QAsUGhvdG9zaG9wIDMuMAA4QklNA+0AAAAAABAASAAAAAEA
AQBIAAAAAQAB/+4ADkFkb2JlAGTAAAAAAf/bAIQABgQEBAUEBgUFBgkGBQYJCwgGBggLDAoKCwoK
DBAMDAwMDAwQDA4PEA8ODBMTFBQTExwbGxscHx8fHx8fHx8fHwEHBwcNDA0YEBAYGhURFRofHx8f
Hx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8f/8AAEQgBAAAsAwER
AAIRAQMRAf/EAaIAAAAHAQEBAQEAAAAAAAAAAAQFAwIGAQAHCAkKCwEAAgIDAQEBAQEAAAAAAAAA
AQACAwQFBgcICQoLEAACAQMDAgQCBgcDBAIGAnMBAgMRBAAFIRIxQVEGE2EicYEUMpGhBxWxQiPB
UtHhMxZi8CRygvElQzRTkqKyY3PCNUQnk6OzNhdUZHTD0uIIJoMJChgZhJRFRqS0VtNVKBry4/PE
1OT0ZXWFlaW1xdXl9WZ2hpamtsbW5vY3R1dnd4eXp7fH1+f3OEhYaHiImKi4yNjo+Ck5SVlpeYmZ
qbnJ2en5KjpKWmp6ipqqusra6voRAAICAQIDBQUEBQYECAMDbQEAAhEDBCESMUEFURNhIgZxgZEy
obHwFMHR4SNCFVJicvEzJDRDghaSUyWiY7LCB3PSNeJEgxdUkwgJChgZJjZFGidkdFU38qOzwygp
0+PzhJSktMTU5PRldYWVpbXF1eX1RlZmdoaWprbG1ub2R1dnd4eXp7fH1+f3OEhYaHiImKi4yNjo
+DlJWWl5iZmpucnZ6fkqOkpaanqKmqq6ytrq+v/aAAwDAQACEQMRAD8A9FeU/KUXl6K5VbmS6e6k
Ls0jSMAC7yUHqPK32pWr8W/U/FyZgAkm0/wodirsVQmracmo6fLZtI0Qk4ssiMyMGRg6kMjI4+JR
9lgfAg74qEk/wSv+CP8ACv12T0vS9D61WXnwr4erX/Y8uHbjx+HBSb3tk2FDsVdirsVdirsVdirs
VdirsVdirsVdirsVdirsVdirsVdirsVdirsVdirsVdirsVdirsVdirsVdirsVdirsVdirsVdirsV
dirsVdirsVdirsVdirsVdirsVdirsVdirsVdirsVdirsVdirsVdirsVdirsVdirsVdirsVdirsVd
irsVdirsVdirsVdirsVdirsVdirsVdirsVdirsVdirsVdirsVdirsVdirsVdirsVdirsVdirsVdi
rsVdirsVdirsVdirsVdirsVdirsVdirsVdirsVdirsVdirsVdirsVdirsVdirsVdirsVdirsVdir
sVdirsVdirsVdirsVdirsVdirsVdirsVdirsVdirsVdirsVdirsVdirsVdirsVdirsVfI/8Azkz5
q80aZ+Z8lrpusXtlbfUrdvQt7mWJOR5VPFGUVOBXlH+PvPf/AFMeqf8ASbcf814q7/H3nv8A6mPV
P+k24/5rxV3+PvPf/Ux6p/0m3H/NeKpn5X89edpfM2kRS+YdSkjkvbdXRrycqymVQQQX3BxV9+YV
fGX/ADlV/wCTXk/5gbb/AI2wK8fxV2KuxVNfKf8AylWjf8x1t/yeXFX6MYVfGX/OVX/k15P+YG2/
42wK8fxV2KuxVNfKf/KVaN/zHW3/ACeXFX6MYVfGX/OVX/k15P8AmBtv+NsCvH8VdirsVTXyn/yl
Wjf8x1t/yeXFX6MYVfLf5l/lr5l/MvzXdeZbeew0G0hjjszHq8tzbMzxPKhK87YVr6RPt06ggBJF
Mcsf+cWPOuoGQWGv+X7sxU9X0LueXjWtOXC3NK8TihF/9ChfmV/1ctG/5H3X/ZNirv8AoUL8yv8A
q5aN/wAj7r/smxVdB/zi/wDmHoF3aazPeaXcQ2NzbzPBbyXbyuBMmyKLapPsMUh9J/40m/wP/ij9
GS19L1/0fSX1OFetfSrTj8XLjxpvWm+NrW9P/9k=</xmpGImg:image> |
It looks like 
, an HTML encoded line feed, was added to this file instead of an actual line feed. Replacing 
 with \n allowed the files to load in my branch (I'm testing some changes to the EPS plugin).
The two "*_preview.eps" files also have a line that is longer than 255 characters at the end, but it looks like binary data so I think that's valid.
Currently the code only checks the line length for lines in the header, and lines after the header that start with a %. Since these test files came from the wild, we probably want to allow files like this, but I thought I'd at least document it.