Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid errors when image size is empty #34

Merged
merged 5 commits into from
Feb 7, 2015
Merged

Conversation

cekk
Copy link
Contributor

@cekk cekk commented Dec 12, 2014

Hi,
i've found that there were a problem when a news has a non "standard" image (for example a bmp or a tiff).
The utils can't get his size, and tried to create a miniature passing width="" and height="", and generate a bad Pillow error: MemoryError.

The strange thing is that with images stored in blob, this doesn't happens.

The workaround is to return None if we can't get the sizes. This could be related (and close) the issue #31

P.S.: some tests don't pass for a buildout problem

@hvelarde
Copy link
Member

@cekk the build is failing on Plone 4.3; could you please help me debugging it?

@cekk
Copy link
Contributor Author

cekk commented Dec 18, 2014

mmm..strange.
In the log i see this in coverage part (after the tests):
No output has been received in the last 10 minutes, this potentially indicates a stalled build or something wrong with the build itself.

Have you ever had a similar problem?
Should i make a fake commit to relaunch the tests? Or is there a way (that i don't know) to relaunch a travis test manually?

@hvelarde
Copy link
Member

this happens when running tests in coverage mode takes too long; but I don't see why is taking too long here.

I already restarted the build a couple of times with no luck.

could you please run the tests in coverage mode locally?

@cekk
Copy link
Contributor Author

cekk commented Dec 19, 2014

locally, the coverage works:

Total: 96 tests, 0 failures, 0 errors in 8 minutes 4.790 seconds.

It's near the 10 minutes limit..maybe travis was a bit slow when the test ran?

@hvelarde
Copy link
Member

the function that generates the images takes too long, Andrea: https://github.com/collective/sc.social.like/blob/master/sc/social/like/testing.py#L12

could you please remove completely that function and add a bunch of static images to the tests folder? I have no time to work on this right now.

that was a bad idea from the beginning.

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling f779316 on fix_image_scale_empty into * on master*.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.06%) when pulling 7f836ba on fix_image_scale_empty into 33ed72b on master.

@keul
Copy link
Member

keul commented Feb 3, 2015

@hvelarde done. Now images are static and they are simply loaded from tests folder.

@coveralls
Copy link

Coverage Status

Coverage decreased (-1.38%) to 95.57% when pulling 8643f43 on fix_image_scale_empty into 33ed72b on master.

hvelarde added a commit that referenced this pull request Feb 7, 2015
Avoid errors when image size is empty
@hvelarde hvelarde merged commit fbbc109 into master Feb 7, 2015
@hvelarde hvelarde deleted the fix_image_scale_empty branch February 7, 2015 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants