Feb-06-2022, 11:32 AM
For my little OMR programme, I need to crop the image I have into columns. Normally this works no problem.
The image is an A4 size .jpg. The 'bubbles' for each question are in rows and, in this case, 2 columns.
I have done this many many times. I keep entering coordinates for cropping, top left, bottom right, until I get what I want, then save the crop-coordinates.
Today something weird is wrong.
I load an image in /home/pedro/summer2022/OMR/20BE/pdf2jpg/20BE11.jpg to get the crop coordinates.
but when I try im.show()
I get "No images found in "file:///tmp/tmpw6yxazsp.PNG" (I can't see how to post the screenshot of the image of the output window, but that's what it says.)
This has always worked without a hitch!
Any clues as to what may be wrong? I guess an update changed something. A permissions thing??
I tried another Python programme I have to make little 5 question answer forms. Same problem, can't get the coordinates. Has always worked.
The image is an A4 size .jpg. The 'bubbles' for each question are in rows and, in this case, 2 columns.
I have done this many many times. I keep entering coordinates for cropping, top left, bottom right, until I get what I want, then save the crop-coordinates.
Today something weird is wrong.
I load an image in /home/pedro/summer2022/OMR/20BE/pdf2jpg/20BE11.jpg to get the crop coordinates.
from PIL import Image, ImageOps image = '/home/pedro/summer2022/OMR/20BE/pdf2jpg/20BE11.jpg'Image opens the jpg, and im is the correct size, A4
Quote:>>> im = Image.open(image)
>>> im
<PIL.JpegImagePlugin.JpegImageFile image mode=RGB size=1654x2339 at 0x7FB3AA6ABA30>
but when I try im.show()
Quote:>>> im.show()
I get "No images found in "file:///tmp/tmpw6yxazsp.PNG" (I can't see how to post the screenshot of the image of the output window, but that's what it says.)
This has always worked without a hitch!
Any clues as to what may be wrong? I guess an update changed something. A permissions thing??
I tried another Python programme I have to make little 5 question answer forms. Same problem, can't get the coordinates. Has always worked.