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

Port PIL Handbook tutorial and appendices #366

Merged
merged 24 commits into from
Oct 7, 2013

Conversation

irskep
Copy link
Contributor

@irskep irskep commented Oct 7, 2013

Click here to see the results

I ported sections 1 (tutorials) and 4 (appendices) from the PIL Handbook.

I also switched the docs to use a Sphinx theme I'm working on. Of course I can snip that commit out if you don't like it, but I think you'll like it.

The API reference is now split into "PIL" and "plugins." The latter is larger and less important, so I made it easier to ignore while still just as accessible.

Additionally, I added a make livehtml target so you don't have to build/refresh manually while editing.

I skipped the reference and tool sections for now. I (or someone else) can come back and do them later. I just got tired of translating HTML to Sphinx by hand.

Let me know if you want anything changed.

@irskep
Copy link
Contributor Author

irskep commented Oct 7, 2013

Oh, I'm still getting some ImportErrors building the docs, not sure if they're important. One about PyQt4 (I probably just didn't install it), and one about _webp, which looks like an extension that isn't getting compiled.

@irskep
Copy link
Contributor Author

irskep commented Oct 7, 2013

As a side note, we really can't have every module on the same page as a long-term API documentation strategy. It's too hard to use, should be split up later.

@wiredfool
Copy link
Member

@irskep Thanks for your work on this. Looks good from a quick skim. I can see areas where pillow has diverged from what's documented, so that's going to be another far less mechanical project. E.g tiff compression, webp in general.

_webp requires libwebp to be installed, it's a relatively new format added in Pillow, not in the original PIL project.

@irskep
Copy link
Contributor Author

irskep commented Oct 7, 2013

If you leave comments on the diff, I can mark them with an out-of-date warning.

@irskep
Copy link
Contributor Author

irskep commented Oct 7, 2013

I'd also be happy to add Python version compatibility notes and installation procedures on the main page.

@irskep
Copy link
Contributor Author

irskep commented Oct 7, 2013

I should also make it clear that I'll probably be less than useful with proofreading specific technical features. I've only ever used PIL casually and just got tired of reading the old PIL docs when using pillow. Plus I like excuses to promote my Sphinx theme. Hence this pull request.

So I won't be able to rewrite the out-of-date sections accurately, just mark them as such and link to the changelog.

Oh, I suppose I should also put the release notes in the docs.

@wiredfool
Copy link
Member

Understood. Those two notes are just the ones that jumped out directly, there's been other bits to be sure. Once we've got this pulled in and converted in its current state of matching PIL 1.1.5 (or so), we (the people who've been hacking and not documenting) are going to need to do some serious updates. At least it's already importing Image from PIL.

^^^

PIL identifies, reads, and writes PNG files containing ``1``, ``L``, ``P``,
``RGB``, or ``RGBA`` data. Interlaced files are currently not supported.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OOD, supported since 1.1.7

@irskep
Copy link
Contributor Author

irskep commented Oct 7, 2013

Yeah, I changed that much. :-)

@irskep
Copy link
Contributor Author

irskep commented Oct 7, 2013

"Writing your own decoder" raw modes table is missing "+ Added limited support for I;16L mode (explicit little endian)." Not sure how to write the description.

@irskep
Copy link
Contributor Author

irskep commented Oct 7, 2013

(We can turn some of these comments into open issues rather than trying to fix them all now)

@irskep
Copy link
Contributor Author

irskep commented Oct 7, 2013

Looks like WMF is supported better than these docs claim. I'm not sure to what degree.

@wiredfool
Copy link
Member

Yeah. Didn't mean to derail with details.

Is there any way that the PIL Package docs can start with Image, or at least highlight it? That's the one that 99% of people are going to want to start with. I'm not even sure that the Plugin stuff is worth having there, given that it's basically a list of internal functions with no documentation.

@wiredfool
Copy link
Member

There are a lot more modes than the documentation lets on. Some more useful than others, many mainly useful as conversions from numpy arrays. I wouldn't worry about them now.

@irskep
Copy link
Contributor Author

irskep commented Oct 7, 2013

Sure, that's no problem. It's good to pick things out here and triage what to do now vs later.

The plugin stuff can matter a lot if you need to do things like set PDF resolution on save, or do JPEG-specific things. That stuff isn't documented at all, but it could be. (These are things I found in the changelog but not in the docs.) So we should probably leave it in. The plugins are all the file format-specific stuff.

@irskep
Copy link
Contributor Author

irskep commented Oct 7, 2013

Is the new TIFF stuff dependent on libtiff being installed separately from PIL or does it get pulled in on install?

@wiredfool
Copy link
Member

The libtiff stuff relies on libtiff+headers being installed. (as is the case with any of the other external libraries. they're technically optional, but some of them are more optional than others).

I agree that the plugins can be useful. However, the current documentation, autogenerated as it is, is not.

@irskep
Copy link
Contributor Author

irskep commented Oct 7, 2013

Okay, I'll take it out of the table of contents and prevent it from being built. Will leave the file intact for the future.

@irskep
Copy link
Contributor Author

irskep commented Oct 7, 2013

Updated TIFF description

@wiredfool
Copy link
Member

Cool. Off for now, will be back in the morning.

@irskep
Copy link
Contributor Author

irskep commented Oct 7, 2013

I'll save porting the README material for a later pull request.

@irskep
Copy link
Contributor Author

irskep commented Oct 7, 2013

Fixed print function stuff in tutorial. Checking out for the night. I recommend we limit further changes to fixing outright errors and save real improvements for separate (and smaller!) branches.

The original link to the preview should stay up to date, I've got it tracking my branch.

@aclark4life
Copy link
Member

Very nice, thanks! Should I merge then @irskep @wiredfool ?

@wiredfool
Copy link
Member

I'd say merge.

aclark4life added a commit that referenced this pull request Oct 7, 2013
Port PIL Handbook tutorial and appendices
@aclark4life aclark4life merged commit 3539af0 into python-pillow:master Oct 7, 2013
@aclark4life
Copy link
Member

Thanks all

@irskep
Copy link
Contributor Author

irskep commented Oct 7, 2013

It looks like RtD didn't update. Does it track a release branch rather than master? Does the Github hook still need to be enabled?

@aclark4life
Copy link
Member


Exception occurred:
  File "/var/build/user_builds/pillow/checkouts/latest/docs/conf.py", line 95, in <module>
    from better import better_theme_path
ImportError: No module named better
The full traceback has been saved in /tmp/sphinx-err-VhyWDV.log, if you want to report the issue to the developers.
Please also report this if it was a user error, so that a better error message can be provided next time.
Either send bugs to the mailing list at <http://groups.google.com/group/sphinx-dev/>,
or report them in the tracker at <http://bitbucket.org/birkenfeld/sphinx/issues/>. Thanks!


@irskep
Copy link
Contributor Author

irskep commented Oct 7, 2013

2 ways to handle this:

  1. Make me an admin of the project on RtD so I can fix it, my username is stevejohnson
  2. Do these things in the admin panel:
    • Enable virtualenv
    • Point the 'requirements file' field at docs/requirements.txt
    • Point the 'Sphinx conf file' field at docs/conf.py

@aclark4life
Copy link
Member

Done (#1)

@irskep
Copy link
Contributor Author

irskep commented Oct 7, 2013

Fixed.

@aclark4life
Copy link
Member

\o/ Thanks.

radarhere pushed a commit to radarhere/Pillow that referenced this pull request Sep 24, 2023
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.

3 participants