Closed jpmn closed 6 years ago
It seems that the first thumbnail (width=100) is created for the first sample. Then it crashes on the second iteration (width=200) with the error: OSError: there is no original image yet
.
If the thumbnail loop contains only one element, then it works for the first thumbnail of all samples. Why is it not possible to generate multiple thumbnails of an image in a row?
I have a list of images and I would like to insert a
Sample
entity in the database for each of them.Here is my
conftest.py
forpy.test
. I have a fixture that creates the store for the whole testing session, and I have another fixture to create a newSQLAlchemy
session for each test.Here is my
test_example.py
which loops over a list of images and tries to insert them in aSample
. Then, I try to create several thumbnails before I commit the session.The test fails in
generate_thumbnail
with the following error message:OSError: there is no original image yet
. The original images are all in the folder hierarchy of the store.What would be the proper way of doing this?
On a side note, I am not sure why I have to specify
unique=True
on the primary key of thePicture
model. I thought a primary key was already a unique constraint. It throws this error without it: