GithubHelp home page GithubHelp logo

Comments (11)

aclark4life avatar aclark4life commented on May 12, 2024

Thank you! I'll try to get this into the upcoming 2.0 release.

from pillow.

aclark4life avatar aclark4life commented on May 12, 2024

Can you send a pull request?

from pillow.

etienned avatar etienned commented on May 12, 2024

I probably can but I need to convert my fork to Git then put it on my Github account. Unfortunately, right now, I don't have time to do this.

I did a patch that you can access here: https://gist.github.com/etienned/5101740

Let me know if it works or if you really need a pull request.

from pillow.

aclark4life avatar aclark4life commented on May 12, 2024

Thanks. I get:


aclark@Alexs-MacBook-Pro:~/Developer/python-imaging/Pillow/ > patch -p1 < t.diff
patching file PIL/JpegImagePlugin.py
Hunk #1 FAILED at 39.
Hunk #2 succeeded at 428 (offset -7 lines).
Hunk #3 succeeded at 445 with fuzz 2 (offset -7 lines).
Hunk #4 succeeded at 511 with fuzz 2 (offset -7 lines).
1 out of 4 hunks FAILED -- saving rejects to file PIL/JpegImagePlugin.py.rej
patching file encode.c
Hunk #1 succeeded at 506 (offset -59 lines).
Hunk #2 FAILED at 571.
Hunk #3 succeeded at 592 with fuzz 2 (offset -54 lines).
Hunk #4 succeeded at 615 (offset -45 lines).
1 out of 4 hunks FAILED -- saving rejects to file encode.c.rej
patching file libImaging/Jpeg.h
patching file libImaging/JpegEncode.c
Hunk #1 FAILED at 146.
1 out of 1 hunk FAILED -- saving rejects to file libImaging/JpegEncode.c.rej
patching file PIL/JpegImagePlugin.py
Hunk #1 succeeded at 416 (offset -8 lines).
Hunk #2 succeeded at 436 (offset -8 lines).
Hunk #3 succeeded at 455 (offset -8 lines).
Hunk #4 succeeded at 462 (offset -8 lines).
Hunk #5 succeeded at 474 with fuzz 1 (offset -8 lines).
Hunk #6 succeeded at 522 (offset -8 lines).
patching file encode.c
Hunk #1 succeeded at 512 (offset -59 lines).
Hunk #2 succeeded at 629 (offset -47 lines).
patching file libImaging/JpegEncode.c
Hunk #1 FAILED at 143.
1 out of 1 hunk FAILED -- saving rejects to file libImaging/JpegEncode.c.rej
patching file PIL/JpegImagePlugin.py
Hunk #1 FAILED at 37.
Hunk #2 succeeded at 448 (offset -8 lines).
Hunk #3 succeeded at 490 (offset -8 lines).
Hunk #4 succeeded at 501 (offset -8 lines).
1 out of 4 hunks FAILED -- saving rejects to file PIL/JpegImagePlugin.py.rej
patching file PIL/JpegPresets.py
patching file encode.c
Hunk #1 succeeded at 523 (offset -59 lines).
Hunk #2 succeeded at 531 (offset -59 lines).
Hunk #3 succeeded at 549 (offset -59 lines).
patching file PIL/JpegImagePlugin.py
Hunk #1 FAILED at 37.
1 out of 1 hunk FAILED -- saving rejects to file PIL/JpegImagePlugin.py.rej
patching file PIL/JpegImagePlugin.py
Hunk #1 succeeded at 450 (offset -9 lines).
Hunk #2 succeeded at 475 (offset -9 lines).
Hunk #3 succeeded at 511 (offset -9 lines).
patching file PIL/JpegPresets.py
patching file PIL/JpegImagePlugin.py
Hunk #1 succeeded at 425 (offset -9 lines).
Hunk #2 succeeded at 473 (offset -9 lines).
Hunk #3 succeeded at 482 (offset -9 lines).
Hunk #4 succeeded at 497 (offset -9 lines).
patching file PIL/JpegPresets.py
patching file encode.c
Hunk #1 succeeded at 531 (offset -59 lines).
Hunk #2 succeeded at 550 (offset -59 lines).


So maybe some stuff has changed since you made your changes…

from pillow.

etienned avatar etienned commented on May 12, 2024

OK, there's some changes between my version and Pillow version, mostly stuff related to raw.

So I forked Pillow and updated it with my code. In general it was pretty simple and straightforward. There's only one place where I'm not sure if the merge I done is correct. It's line 593 in encode.c. In my previous version the diff of this line was:

-    if (!PyArg_ParseTuple(args, ARG("ss|iiiiiiiis#", "ss|iiiiiiiiy#"),
+    if (!PyArg_ParseTuple(args, ARG("ss|iiiiiiiiOs#", "ss|iiiiiiiiOy#"),

At the moment I don't remember how this ARG stuff is supposed to work. I still don't have time to search that and test my changes to Pillow (I was not supposed to put some time on Pillow at all today...).

So do you want to test it or wait that I test it? If you want to test it I will send you a pull request.

from pillow.

aclark4life avatar aclark4life commented on May 12, 2024

Please send a pull request and I or someone else will test, thanks! Also if you can easily add some general testing instructions to the pull request, please do. E.g. verify call to ARG, etc.

from pillow.

d-schmidt avatar d-schmidt commented on May 12, 2024

@etienned line 593 looks correct

from pillow.

aclark4life avatar aclark4life commented on May 12, 2024

OK so just waiting for pull request I guess

from pillow.

etienned avatar etienned commented on May 12, 2024

Pull request sent.

from pillow.

aclark4life avatar aclark4life commented on May 12, 2024

@etienned Can you send me the URL? I can't find it…

from pillow.

aclark4life avatar aclark4life commented on May 12, 2024

Never mind, I merged it, thanks!

from pillow.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.