PMXBOT Log file Viewer

Help | Karma | Search:

#pil logs for Wednesday the 5th of March, 2014

(Back to #pil overview) (Back to channel listing) (Animate logs)
[03:46:00] <prooty> hello. i am trying to install Pillow 2.3.0 in Ubuntu 12.10 with Python 2.7.3.
[03:46:27] <prooty> i am trying to include tkinter support, so i installed tcl8.5-dev and tk8.5-dev.
[03:46:52] <prooty> however after building Pillow tkinter support is still not available.
[03:47:15] <prooty> i also tried with tcl8.4-dev and tk8.4-dev.
[04:08:13] <prooty> have resolved my issue. python-tk also needs to be installed.
[06:22:12] <prooty> Pillow hangs when trying to open a PostScript document. i know it is not supported, but a better behavior is to timeout or raise an error rather than hanging.
[10:28:10] <terseus> Hello
[10:28:33] <terseus> I've been digging in the pillow source recently, trying to investigate issue https://github.com/python-imaging/Pillow/issues/367
[10:29:55] <terseus> I've seen that the functions polygon8, polygon32 and polygon32rgba are exactly the same, except in the calls to the hline functions, where it calls the correspondent one
[10:31:03] <terseus> is there any reasoning behind this copy&pasted code?
[10:31:24] <terseus> I mean, why not refactor it so all the polygon functions share the same code base?
[11:04:46] <tapia> Hi
[11:05:05] <tapia> I need to add some white space above my image
[11:05:19] <tapia> I only find resize() in the docs, but that's not what I want to do
[11:05:32] <tapia> how could I do that?
[11:13:24] <terseus> you can create a new empty image, paste the original image in the new with the appropiate coords and fill the rest with white pixels
[11:14:09] <tapia> terseus: what about Image.transform?
[11:15:51] <terseus> I never used it so I don't know, but from reading the doc should work, too
[11:28:50] <tapia> terseus: the new empty image and paste the original works fine
[11:28:54] <tapia> thank you very much :-)
[11:29:51] <terseus> :)
[12:32:48] <terseus> wiredfool: are you there? I would like to talk about the issue 367, the problem with wrong lines width
[16:39:27] <wiredfool> terseus: I'm here now
[16:40:16] <terseus> me too, I wrote a comment in the github issue
[16:40:31] <wiredfool> saw that.
[16:42:08] <terseus> and what do you think, it's feasible changing the behavior of polygon functions without breaking other library components?
[16:42:50] <wiredfool> It's pretty much a leaf node. I think it's called from a few places in Draw.c, but I don't think that there's any calls from outside
[16:45:17] <wiredfool> I'm only seeing the 4 function calls to polygon in draw.c
[16:46:08] <terseus> good, then I will try to modify them and will see if all the tests pass
[16:46:18] <wiredfool> you may need to add additional tests
[16:46:48] <terseus> what tests do you recommend me to add?
[16:47:18] <wiredfool> well, since everything passes right now in master, bug #367 is untested
[16:47:30] <wiredfool> tho, I think I've got a test for it in a branch somewhere
[16:47:46] <terseus> yeah I found it, I'm using it now in my branch
[16:48:30] <wiredfool> ok
[16:48:53] <terseus> also, as a side note, I noted that all the polygon functions (8, 32 and 32argb) have the same logic, only the calls to the hline functions change
[16:50:24] <terseus> my idea is, first refactor them so all share the same code base, probably creating a function polygon_generic that have the logic and gets a pointer to a function with the same signature as hline
[16:50:34] <wiredfool> feel free to refactor/dedup
[16:50:44] <wiredfool> I suspect you'll find the same thing in line
[16:50:56] <wiredfool> as it only varies by point function
[16:51:25] <wiredfool> (by eye, I haven't diffd)
[16:51:59] <terseus> ok, cool, I will try to fix it
[16:52:05] <wiredfool> but the pgup/pgdown diffs are looking similar
[16:52:40] <wiredfool> I'd bet hline and point are the only ones that are actually different
[16:53:44] <terseus> well, I will take it easy :)
[16:53:50] <terseus> first, refactor polygon
[16:53:58] <terseus> then, try to fix the bug
[16:54:09] <terseus> then, will take a look at line functions
[17:00:38] <wiredfool> good luck, write when you find good test results
[17:00:48] <wiredfool> and if you need help, I lurk
[18:00:13] <tomswirly> Good day, all. I'm attempting to simply create an ImageFont of a given height, but I am getting poor results. The following gist has an example: https://gist.github.com/rec/9299379
[18:00:33] <tomswirly> I wasn't able to find any font where the "advertised" height was the same as the "actual" height, in fact!
[18:01:38] <wiredfool> hey tomswirly
[18:01:43] <tomswirly> hello again!
[18:01:51] <tomswirly> how's your day progressing?
[18:02:02] <wiredfool> the caffiene is starting to work
[18:02:31] <tomswirly> best part of the day. I have switched to high-caffeine coffee recently to fuel the beast.
[18:02:44] <tomswirly> so I have a simple task - generate a font of an exact pixel height.
[18:02:58] <tomswirly> unfortunately, I get bad results, even when I'm using a pixel font with a given height.
[18:03:03] <wiredfool> ttf.
[18:03:11] <tomswirly> oops, yes, truetype.
[18:03:43] <wiredfool> so, there are a bunch of metrics for fonts. size is ambiguious
[18:03:52] <wiredfool> but, it's what we pass to freetype, so it's what we use
[18:04:06] <wiredfool> I'm going to guess that the height you're getting back is the bounding box
[18:04:28] <tomswirly> suppose I wish to fit text into a box of a very specific height. How would I do that?
[18:04:47] <tomswirly> oh, hmm, so you're saying you're basically a wrapper around free type.
[18:04:48] <wiredfool> and the height that you're specifying is the cap height
[18:04:57] <wiredfool> without descenders and ascenders
[18:05:05] <tomswirly> yes.
[18:05:33] <tomswirly> so there's no actual way to request a font that fits into a given height.
[18:05:43] <wiredfool> so, frex, if you get the metrics on a string like 'M' or 'S', the height should be what you expect
[18:06:06] <tomswirly> yes, but I have a habit of using things like "g" or '
[18:06:07] <wiredfool> I'd have to dig through the freetype docs
[18:06:25] <wiredfool> I'm not certain if there are ascender or decender metrics exposed
[18:06:25] <tomswirly> I can do that myself, now I realize that you're basically passing it through.
[18:06:45] <wiredfool> yeah, we're not doing anything to it other than calling out to freetype
[18:07:05] <wiredfool> though, if you need pixel perfect, we can use pixel fonts
[18:07:11] <tomswirly> wait, you can?!?!
[18:07:12] <wiredfool> like .pcf,
[18:07:22] <tomswirly> no sh, er, no fooling!
[18:07:48] <tomswirly> oh, pixel fonts are really what I want, it's for a display with a fairly small number of super-bright LEDs.
[18:08:06] <wiredfool> there you are.
[18:08:06] <tomswirly> great then, I'll look into that immediately. just what I wanted to hear.
[18:08:32] <wiredfool> the internal pixel font format is just (essentially) a dict of ord:image
[18:08:32] <tomswirly> thanks again. please accept a beverage of your choice from me if you are ever in New York City.
[18:09:00] <wiredfool> ok. though, it's been 20 years since I drove through
[18:09:18] <tomswirly> there's your problem right there - driving through NYC. :-)
[18:09:43] <wiredfool> yeah. dead reckoning from LI to the bridge halfway up on the westside
[18:10:00] <tomswirly> George Washington Bridge
[18:10:03] <wiredfool> yeah
[18:10:04] <tomswirly> very spectacular view.
[18:10:32] <tomswirly> I believe I know two people in NYC with cars… the subway is really a treasure.
[18:10:42] <tomswirly> OK, off to research PCF fonts.
[18:10:52] <wiredfool> you might look at the pcf tests
[18:11:07] <tomswirly> "tests"? what sort of engineers are you?! ;-)
[18:11:16] <wiredfool> there's also a recent patch to make ord(c)>128 work reasonably properly on py3.x
[18:11:41] <wiredfool> I like tests. Especially when they're passing.
[18:11:52] <tomswirly> actually, I can't live without tests.
[18:12:07] <wiredfool> I can. It's just unpleasant.
[18:12:31] <tomswirly> my private project that this is for, https://github.com/rec/echomesh, has…er… 339 tests
[18:13:06] <tomswirly> https://en.wikipedia.org/wiki/Shotgun_debugging
[18:13:40] <wiredfool> yeah. and. what's worse, it was nosql in the days when it was.... a severe limitation.
[18:14:52] <tomswirly> still is. even though my "commercial application" is essentially nosql.
[18:15:06] <tomswirly> it's joins that are the difficulty.
[18:15:16] <tomswirly> but I'm not really a database person.
[18:15:23] <wiredfool> there's nosql, and then there's monolithic object databases.
[18:16:02] <tomswirly> http://www.sarahmei.com/blog/2013/11/11/why-you-should-never-use-mongodb/
[18:16:12] <wiredfool> I got to the point where I proved that we couldn't have data integrity. and then I ported to postgresql
[18:16:50] <tomswirly> you can have data integrity IF you denormalize everything and don't mind everything being locked during your really slow updates. :-D
[18:17:16] <wiredfool> it wouldn't have been half so bad if it was web scale, but when you're stuck on one machine max per customer and you get a big customer...
[18:17:30] <tomswirly> ouch.
[18:17:37] <wiredfool> this was 99/00
[18:17:53] <tomswirly> steam-powered computers and such.
[18:18:17] <wiredfool> I've got a picture somewhere of a squirrel in the server room
[18:20:07] <tomswirly> dead or alive?
[18:20:17] <wiredfool> live. on the floor.
[18:20:38] <wiredfool> this was the startup that moved into suite 404.
[18:20:45] <wiredfool> error: startup not found
[18:22:35] <tomswirly> yes, I have been involved in multiple startups - including a pocket computer in the 80s.
[18:22:50] <tomswirly> I have had enough worthless options to paper my bathroom.
[18:23:19] <tomswirly> but you only need to have them pay off once...
[18:25:56] <wiredfool> my options weren't nice enough to paper that bathroom.
[18:26:23] <wiredfool> the
[18:26:31] <tomswirly> and probably too hard for other bathroom paper uses.
[18:26:44] <wiredfool> yeah. recycled grey office paper
[18:27:48] <tomswirly> all right, I think I have a handle on this problem now. I'm going to keep my .ttf code with all the tweaks and add a separate .pcf handler, which will probably give better results.
[18:28:49] <tomswirly> have a great day, and keep your caffeine level up! :-)