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

A few small patches to image handling #3082

Merged
merged 4 commits into from Mar 27, 2013
Merged

Conversation

minrk
Copy link
Member

@minrk minrk commented Mar 26, 2013

  1. tweak double-encode logic for image data

    Instead of only b64-encoding for valid image data, b64-encode unless it is specifically detected as b64-encoded valid image data. This prevents garbage data from skipping the b64 step, and causing unicode errors.

  2. check image header to identify image type

  3. allow Image("filename")

    We already support passing a URL this way, it's silly to not support passing a filename, as user reports have shown many times.

Closes #3081

instead of only b64-encoding for valid image data,
b64-encode unless it is specifically detected as b64-encoded valid image data.
This prevents garbage data from skipping the b64 step,
and causing unicode errors.

Closes ipython#3081
@Carreau
Copy link
Member

Carreau commented Mar 26, 2013

Looks alright.
I'll leave it a few hours for others to see.

Carreau added a commit that referenced this pull request Mar 27, 2013
A few small patches to image handling
@Carreau Carreau merged commit b4484c7 into ipython:master Mar 27, 2013
@minrk minrk deleted the image_garbage branch March 31, 2014 23:36
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this pull request Nov 3, 2014
A few small patches to image handling
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.

UnicodeDecodeError when using Image(data="some.jpeg")
2 participants