Dec

11

On PIL and aggdraw

This isn't in "Developer Stuff" because it isn't related to Django and I don't want to pollute the Django Community Aggregator.

Along with my addition of the "public" field last night, I also refactored my clock rendering code to use the aggdraw library because it's compatible with PIL and it renders nice, anti-aliased lines.

The refactoring wasn't completely trivial, but it wasn't so bad, but I ran into a whole other mess when I tried compiling aggdraw on my slice.

It compiled fine on the Ubuntu VPS I had running inside VMWare Fusion, but on the slice gcc threw an error because the code was attempting to cast the data in a way that would "lose precision".

I beat my head against this for about an hour before I noticed that when I was compiling for the slice the target was for x86-64. I search for 64-bit related errors in aggdraw and I found a post. Subhash Chandra's fix did the trick. I'm posting his diff below, because Subhash's blog doesn't give him nifty coloured code outputting.

Index: agg2/include/agg_array.h
===================================================================
--- agg2/include/agg_array.h (revision 521)
+++ agg2/include/agg_array.h (working copy)
@@ -520,7 +520,7 @@
int8u* ptr = m_buf_ptr;
if(alignment > 1)
{
- unsigned align = (alignment - unsigned(ptr) % alignment) % alignment;
+ unsigned align = (alignment - (unsigned long)(ptr) % alignment) % alignment;
size += align;
ptr += align;
if(size <= m_rest)

And of course, quoth the author: YMMV.

[HTML_REMOVED]free full length movies[HTML_REMOVED]

Did you ever wish that you could watch the latest released movies at comfort of your home without going out anywhere and thus save your hard earned money. Or it could be that you are left with no time to go out because of your busy schedule and daily chores. Release your worries because its time to visit http://free-full-length-movies.net to watch your favorite movies.

Free-full-length-movies.net collects working movie links scattered around the Internet and put them in orderly manner so you could have best time watching free movies. Movies indexed in Free-full-length-movies.net are carefully selected keeping in context popularity and ratings. All the latest released movies are only a click away, so just sit back and enjoy your time watching your favorite [HTML_REMOVED]free full length movies[HTML_REMOVED] at Free-full-length-movies.net For more info visit: http://free-full-length-movies.net

watch free movies, watch free movie, online movies for free, watch free movies online, watch movies online, watch full length movies, watch films online, free online movies, watch free films, free full movie downloads, watch full movies online, watch free online movies

http://free-full-length-movies.net

freefulllengthmovies (November 09, 2009 at 4:03 a.m.)

Hi,

I want to create my website too, could you help me ?

++

Motercalo (June 17, 2010 at 3:39 p.m.)

Thanks for this diff that helps aggdraw compile on 64 bit systems

Hari (June 21, 2010 at 6:42 p.m.)

This is such a great resource that you are providing and you give it away for free. I enjoy seeing websites that understand the value of providing a prime resource for free. I truly loved reading your posts on www.pocketuniverse.ca . Thanks!

nandrolone (December 04, 2011 at 7:43 p.m.)