PMXBOT Log file Viewer

Help | Karma | Search:

#pil logs for Friday the 14th of March, 2014

(Back to #pil overview) (Back to channel listing) (Animate logs)
[17:24:33] <wiredfool> now that's a pull request
[22:32:48] <danostrowski> Hi all.
[22:33:34] <danostrowski> I'm creating a new RGBA image... then overlaying a transparent PNG where I've changed the color... and losing the transparency.
[22:33:47] <danostrowski> Actually, hold on, let me check the changing the color isn't screwing the transparency up
[22:34:15] <danostrowski> hmm, nope it's not that.
[22:34:33] <wiredfool> what's the mode of the png?
[22:34:55] <danostrowski> good question. maybe I need to explicitly supply the "RGBA" to it.
[22:34:58] <danostrowski> in the constructor.
[22:35:02] <danostrowski> er, in the open() call
[22:35:52] <danostrowski> oh. "RGBA" is a "bad mode"
[22:35:57] <danostrowski> ohh... kay..
[22:36:21] <danostrowski> oh wait. that's the file mode.
[22:37:14] <danostrowski> when I open the transparent PNG it's mode is 'RGBA'
[22:37:25] <danostrowski> which is the same mode as the image object I'm creating.
[22:37:42] <danostrowski> I've double checked this transparent PNG is in fact transparent by opening it in a separate program.
[22:38:15] <danostrowski> I can't imagine some compile option is wrong...
[22:42:13] <danostrowski> I don't really know what "LA" mode is, but I'm assuming RGBA is the right mode...
[22:48:39] <danostrowski> Ah, ha.
[22:49:18] <wiredfool> sorry, was afk
[22:49:28] <wiredfool> yeah. that's a stupid interface
[22:49:45] <danostrowski> there's a way to pull the alpha band out of an image so I can feed that in as the mask, yeah?
[22:49:52] <danostrowski> I can't really remember what it is...
[22:50:02] <wiredfool> I think you can just shove the whole image in
[22:50:07] <danostrowski> oh.
[22:50:11] <danostrowski> oK, I'll try that.
[22:50:30] <danostrowski> ho HO!
[22:50:35] <danostrowski> that looks a bit better.
[22:50:53] <danostrowski> now, the text I'm drawing is still the wrong color ...
[22:50:55] <wiredfool> you might also want to look at alpha_composite
[22:51:06] <danostrowski> hm, OK
[22:51:23] <wiredfool> unless you have success, then. yay
[22:51:28] <danostrowski> hehe, yeah it worked.
[22:51:38] <danostrowski> I thought composite made a sort of... mesh of the two images, which is not exactly what I want?
[22:51:44] <danostrowski> I could try it, but this worked.
[22:51:50] <danostrowski> now I just have to get the draw.text() thing working.
[22:52:31] <danostrowski> oh, actually
[22:52:35] <danostrowski> that might be just missing a param
[22:55:11] <danostrowski> ok, yeah.
[22:55:15] <danostrowski> just missed a fill= param.
[22:55:26] <danostrowski> now the tough part. taking this large PNG and turning it into a more printable PDF. o.O
[23:09:27] <wiredfool> aclark: ping that PR is for the first CVE I've seen on pillow.
[23:10:01] <aclark> wiredfool: k
[23:12:33] <wiredfool> also, looks like 2.3 is making it into the ubuntu lts for next month
[23:12:36] <aclark> wiredfool: mkstemp is "secure"?
[23:12:40] <aclark> wiredfool: \o/ nice
[23:12:41] <wiredfool> yep
[23:13:06] <wiredfool> http://docs.python.org/2/library/tempfile.html#tempfile.mkstemp
[23:13:23] <aclark> nice
[23:14:59] <aclark> wiredfool: do we need to get a release out to address the CVE?
[23:15:14] <wiredfool> I'd say yes.
[23:15:39] <wiredfool> not that its _urgent_, since it's been there for ca 15 years.
[23:15:43] <aclark> OK then i'll probably go ahead with 2.4 early
[23:15:46] <wiredfool> but hell, it's a CVE
[23:15:58] <aclark> hah
[23:15:59] <aclark> yep
[23:16:01] <wiredfool> It's probably better to do a 2.3.1 release
[23:16:08] <aclark> k
[23:16:12] <wiredfool> not bury it in the feature release
[23:16:24] <aclark> well then if you do the backport i'll release a 2.3.1
[23:16:30] <wiredfool> There are still a lot of merges that I'd like to get into 2.4
[23:16:32] <aclark> or the cherrypick or whatever
[23:16:36] <wiredfool> ok.
[23:16:38] <wiredfool> will do
[23:16:41] <aclark> k
[23:16:44] <aclark> thx
[23:20:12] <danostrowski> hmm.
[23:20:30] <danostrowski> is Image.info reliable? Like, can I just write something into that dict?
[23:21:41] <wiredfool> somethings are used for saving, some aren't
[23:22:10] <danostrowski> Ah.
[23:22:23] <wiredfool> what are you trying to add?
[23:22:43] <danostrowski> Oh, just, like a copyright.
[23:22:47] <danostrowski> original design and all that.
[23:23:59] <wiredfool> so, like to put in the exif?
[23:24:05] <danostrowski> Yeah.
[23:24:09] <danostrowski> http://www.w3.org/TR/PNG/#11textinfo
[23:24:12] <danostrowski> I think this is what I'm after?
[23:25:18] <danostrowski> oh. interesting.
[23:25:26] <danostrowski> I guess you pass a pnginfo?
[23:25:27] <danostrowski> in save?
[23:25:29] <wiredfool> I think what you want to do is pass a
[23:25:30] <wiredfool> yes
[23:25:37] <wiredfool> tha
[23:25:39] <danostrowski> is that even documented?
[23:25:40] <wiredfool> t
[23:25:40] <danostrowski> lol
[23:26:08] <wiredfool> good question. I've used it in the past, but I'd have to grep for the docs
[23:26:35] <wiredfool> grep says no
[23:27:08] <danostrowski> :)
[23:27:37] <wiredfool> there's code in PngImagePlugin.
[23:27:47] <danostrowski> Yeah, found it. :)