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

Improve Image format validation and add html width,height #2231

Merged
merged 2 commits into from Aug 2, 2012

Conversation

Carreau
Copy link
Member

@Carreau Carreau commented Aug 1, 2012

merge #2178 , #2219 , #2226 in one PR.

by cherry-picking the commit of #2226 on top of #2219


This addresses the first two bullets of #2053
Validates first argument to constrain format to png, jpeg,
Lets user specify width, height, or both and emits appropriate html

I introduced a couple of class constants to minimize the number of times I saw 'jpeg' and 'png'
and document the _ACCEPTABLE_FORMATS.

I added one real jpeg image to the test directory and one zero-length gif file to survive the file not found
error in super()

Thanks, Min, for the coaching, I hope it looks adequate.

Closes #2053

jerryatmda and others added 2 commits July 29, 2012 17:25
Image now complains if it receives neither filename, url, nor data (param1)
Image honors width and height on html.
tests/test_display.pl exhibits this new behavior
@takluyver
Copy link
Member

This seems to be passing the tests, although there's a problem with Python 3 matplotlib that's causing failures. I've made a PR to sort that out again.

@Carreau
Copy link
Member Author

Carreau commented Aug 2, 2012

well, merging then.

Carreau added a commit that referenced this pull request Aug 2, 2012
Improve Image format validation and add html width,height

This addresses the first two bullets of #2053
Validates first argument to constrain format to png, jpeg,
Lets user specify width, height, or both and emits appropriate html

I introduced a couple of class constants to minimize the number of times I saw 'jpeg' and 'png'
and document the _ACCEPTABLE_FORMATS.

I added one real jpeg image to the test directory and one zero-length gif file to survive the file not found error in super()

Closes #2053

Add `assert_is_none`, `assert_is_not_none` to `nose.tools`
@Carreau Carreau merged commit 19feb23 into ipython:master Aug 2, 2012
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this pull request Nov 3, 2014
Improve Image format validation and add html width,height

This addresses the first two bullets of ipython#2053
Validates first argument to constrain format to png, jpeg,
Lets user specify width, height, or both and emits appropriate html

I introduced a couple of class constants to minimize the number of times I saw 'jpeg' and 'png'
and document the _ACCEPTABLE_FORMATS.

I added one real jpeg image to the test directory and one zero-length gif file to survive the file not found error in super()

Closes ipython#2053

Add `assert_is_none`, `assert_is_not_none` to `nose.tools`
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.

Improvements to the IPython.display.Image object
4 participants