Good afternoon. Please help: KeyError 262 errors occur during batch processing of files.
The 'АЦБР.466453.161-02.03И1.tif' file is being processed...Traceback (most recent call last):
File "D:\1234567\tiff2pdf.py", line 89, in <module>
main()
File "D:\1234567\tiff2pdf.py", line 75, in main
fuck = tiff2pdf()
File "D:\1234567\tiff2pdf.py", line 32, in tiff2pdf
converted_pdf = img2pdf.convert(input_file)
File "C:\Users\____\AppData\Roaming\Python\Python38\site-packages\img2pdf.py", line 2263, in convert
) in read_images(
File "C:\Users\____\AppData\Roaming\Python\Python38\site-packages\img2pdf.py", line 1665, in read_images
photo = imgdata.tag_v2[TiffImagePlugin.PHOTOMETRIC_INTERPRETATION]
File "C:\Users\____\AppData\Roaming\Python\Python38\site-packages\PIL\TiffImagePlugin.py", line 541, in __getitem__
data = self._tagdata[tag]
KeyError: 262
Good afternoon. Please help: KeyError 262 errors occur during batch processing of files.
```
The 'АЦБР.466453.161-02.03И1.tif' file is being processed...Traceback (most recent call last):
File "D:\1234567\tiff2pdf.py", line 89, in <module>
main()
File "D:\1234567\tiff2pdf.py", line 75, in main
fuck = tiff2pdf()
File "D:\1234567\tiff2pdf.py", line 32, in tiff2pdf
converted_pdf = img2pdf.convert(input_file)
File "C:\Users\____\AppData\Roaming\Python\Python38\site-packages\img2pdf.py", line 2263, in convert
) in read_images(
File "C:\Users\____\AppData\Roaming\Python\Python38\site-packages\img2pdf.py", line 1665, in read_images
photo = imgdata.tag_v2[TiffImagePlugin.PHOTOMETRIC_INTERPRETATION]
File "C:\Users\____\AppData\Roaming\Python\Python38\site-packages\PIL\TiffImagePlugin.py", line 541, in __getitem__
data = self._tagdata[tag]
KeyError: 262
```
The error doesn't come from img2pdf but from PIL/TiffImagePlugin.py. It seems that your tif file is missing the PHOTOMETRIC_INTERPRETATION tag. Can you post the file that you are having problems with?
The error doesn't come from img2pdf but from PIL/TiffImagePlugin.py. It seems that your tif file is missing the PHOTOMETRIC_INTERPRETATION tag. Can you post the file that you are having problems with?
So this is not an img2pdf bug. Your input is broken.
That's just a corrupt image file. Even imagemagick says:
identify-im6.q16: improper image header `ðÉðªðæðá.466453.161-02.03ð1.tif' @ error/tiff.c/ReadTIFFImage/1327.
So this is not an img2pdf bug. Your input is broken.
It's a pity, because there are a lot of such files in the bundle. :-(
These files are opened and translated to pdf, for example FineReader.
Can you tell me how you can solve the problem?
It's a pity, because there are a lot of such files in the bundle. :-(
These files are opened and translated to pdf, for example FineReader.
Can you tell me how you can solve the problem?
First, I'd send a bug report to the maintainers of the software that produced these files.
Second, I'd try finding some software that can open those files and convert them to another lossless raster graphics format like png.
First, I'd send a bug report to the maintainers of the software that produced these files.
Second, I'd try finding some software that can open those files and convert them to another lossless raster graphics format like png.
Good afternoon. Please help: KeyError 262 errors occur during batch processing of files.
The error doesn't come from img2pdf but from PIL/TiffImagePlugin.py. It seems that your tif file is missing the PHOTOMETRIC_INTERPRETATION tag. Can you post the file that you are having problems with?
Here on the site, I couldn't add it, I threw it on Google Drive
https://drive.google.com/file/d/1SbsQ1ex-GdF9zkbo0bhpNPEBGCUrn_pL/view?usp=drivesdk
I don't have a Google account so I cannot retrieve the file.
You can attach it to a post by first putting it into a zip archive.
Ok
That's just a corrupt image file. Even imagemagick says:
So this is not an img2pdf bug. Your input is broken.
It's a pity, because there are a lot of such files in the bundle. :-(
These files are opened and translated to pdf, for example FineReader.
Can you tell me how you can solve the problem?
First, I'd send a bug report to the maintainers of the software that produced these files.
Second, I'd try finding some software that can open those files and convert them to another lossless raster graphics format like png.
Okay, thanks a lot.