It was a bad day. A lot of bad stuff happened. And I'd love to forget it all. But I don't. Not ever. Because this is what I do. Every time, every day, every second, this: On five, we're bringing down the government.

Monday, July 30

Geek

Limits Of Shrinkage

I'll have to tidy this up and post it at mee.nu, but a few notes on the image resizing features in Minx.  Except where noted, these apply to both manual and automatic resizing.
  • If you resize an 8-bit GIF or PNG image with transparency (index or alpha), the transparency will be lost.  If you need to retain the transparency, you'll either need to resize it using a paint program (Paintshop Pro, Fireworks, Photoshop) or use a 32-bit RGBA PNG file instead.  This is an issue with the image library used by Minx, and isn't likely to be fixed soon.
  • If you resize an animated GIF, only the first frame of the animation will be kept.  This is fixable, but not a very high priority.
  • For automatic resizing only, if the resulting image is up to 1100 pixels in dimensions (e.g. 500x600, 300x800), the system will apply a high-quality but CPU-intensive Anti-aliasing filter.  For larger sizes, it will fall back to a bilinear filter, which is good enough for photos but will show some aliasing (jaggies) on line drawings.
  • In Minx 1.05, manually resized JPGs are processed with a quality setting of 75%; automatically resized JPGs with a setting of 85%.  In Minx 1.1, the default for both modes is 80%, with a quality/q option available to override this: [img=/images/foofle.jpg size=50% q=90%]

Posted by: Pixy Misa at 10:35 PM | No Comments | Add Comment | Trackbacks (Suck)
Post contains 219 words, total size 1 kb.

Geek

Mmm, Cookies!

Should I call server-side cookies, cookies, or is that going to confuse people?

Posted by: Pixy Misa at 06:11 AM | Comments (7) | Add Comment | Trackbacks (Suck)
Post contains 15 words, total size 1 kb.

Sunday, July 29

Geek

Applets, Libraries And Functions (In No Particular Order)

Some of the features discussed in this article are included in the forthcoming 1.1 release. If you try to use these features in 1.0, they probably won't do anything.

The problem with a hosted service like mee.nu is that you can't extend it with plugins.  You certainly can't upload your own PHP files, at least, not if you expect them to do anything.  Minx templates are very flexible and reasonably easy to work with, but they don't make it simple to use a piece of code someone else has designed.

Or they didn't - until now.

[def]
[call]

One of the (previously) undocumented features of Minx is template functions. You can define a function in a template like so:
[def comment]
<tr [if comment.even]bgcolor="#f8f4e0"[/if]>
<td>[comment.authorlink]</td>

...

[/def]
And then call it like so:
[comments count=20 order=desc show=junk paged]
[call comment]
[/comments]
You can pass in parameters the same way you can with templates... which is another undocumented feature:
[include EditorSettings text Text]
Which are substituted into the template (or function... basically the same thing) as indicated by markers of the form {1}, {2} and so on for the first, second, and so onth parameter:
<td align="right"><label for="{1}">&nbsp;&nbsp;{2}</label></td>
Functions, once defined, persist and can be re-used whenever you want. That brings us to the first and simplest of the new features, libraries.

[library]

A library is simply a template that contains a set of functions. Libraries do not produce any output directly, but the functions can be used by any other templates, sub-templates, or applets that you use.

Libraries can be called from another site if the library is flagged as shared. A library will only ever be included once in your template; multiple references to the same library will be skipped.

The process of including a library cannot change global template variables, though the library can read global variables and create local variables. The library can read and update user options.

Calling a library creates a library object, which can be examined both within the library and in the template that called the library.

[applet]

An applet is again just a template with restrictions. As described in the previous post, an applet can be called from another site, and cannot change global variables or template functions.

(I stopped and measured the overhead of an applet vs. a regular template on the test environment. It's about 20μs.)

Apart from producing output in your page, an applet also returns an applet object.  Applets can also read and update user options.  (More on that subject shortly.)

Posted by: Pixy Misa at 10:32 PM | Comments (2) | Add Comment | Trackbacks (Suck)
Post contains 408 words, total size 4 kb.

Geek

Ooh, I Just Had A Think

New feature coming in Minx 1.1: Applets.

Applets are just templates, but with some specific features and limitations:
  • Applets are called using the [applet] tag rather than [include]
  • You can call an applet from your local applets pool, from the global applet collection, or specifically from another Minx site, e.g. [applet ai.mee.nu:Weather AU.Sydney]
  • Like any template, applets can include Metl code (Minx Extensible Template Language), HTML, BBCode, JavaScript and CSS
  • Applets cannot update global template variables or global template functions
  • Applets can update user options
It'll only take me about a day to do all of this, but it will allow users to easily share functionality.  It does depend on the user option system... which will also take about a day.

I was going to leave this for 1.2, but I think I'll move it up.  Look for it soon!

Posted by: Pixy Misa at 03:57 PM | No Comments | Add Comment | Trackbacks (Suck)
Post contains 139 words, total size 1 kb.

Saturday, July 28

Geek

RSS And All That

Recently Steven had a comment that was held for moderation (it had a junk score between 5 and 10).  He didn't know this, because Minx doesn't notify the blogger when new comments arrive.  It doesn't do that because I really don't want the server sending out thousands, and eventually perhaps millions, of emails every day.

But bloggers still need to know when new comments arrive.

One thing Minx can do is generate an RSS feed for any folder.  There's a folder at yourblog:/edit/comment that presents a list of comments, and an RSS feed of that would give you a feed of all new comments as they arrive.  Perfect!

Except... That folder is private, so you have to log in to read it.  This seems to be impossible under Thunderbird, which is what I use for my RSS feeds.  It works under Firefox, but the Firefox RSS reader is unuseable for this task.

So the question is, do people think this functionality is a good idea?  I like it because can easily be extended to other things, providing you with a feed of everything that goes on on your blog without the server having to grind through the data all the time.

And what feed readers do you use?  Do they support cookies?

I'm considering a little desktop app to help manage this sort of thing, but that's months away, and will probably be Windows-only (though the API will be open) so I'm looking for something I can do in the meantime.

Posted by: Pixy Misa at 06:45 PM | Comments (6) | Add Comment | Trackbacks (Suck)
Post contains 255 words, total size 1 kb.

Friday, July 27

Geek

Okay, I Have Got To Try This Out

òóôõöōŏőǒǫǭȍȏȫȭȯȱṍṏṑṓọỏồốổỗộớờởỡợ

Heh.  Cool.  Though they should all be the same size.  Blame Microsoft.  (In fact, if I reduce my font size one notch, they are all the same size.  Looks like a glitch in the hinting in Verdana.)

ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ
αβϐγδεζηθϑικλμνξοπρστυφϕχψως


It's all Greek to me...

ἀἁἂἃἄἅἆἇᾳᾀᾁᾂᾃᾄᾅᾆᾇᾲᾴᾷὰάᾶᾰᾱἠἡἢἣ
ἤἥἦἧῃᾐᾑᾒᾓᾔᾕᾖᾗῂῄῇὴήῆὠὡὢὣὤὥὦ
ὧῳᾠᾡᾢᾣᾤᾥᾦᾧῲῴῷὼώῶἐἑἒἓἔἕὲέῤῥ
ὀὁὂὃὄὅὸόὐὑὒὓὔὕὖὗὺύῠῡῢΰῦῧ

#©01234567891⁄41⁄23⁄4°%‰
⁰¹²³⁴⁵⁶⁷⁸⁹⁺⁻⁼⁽⁾₀₁₂₃₄₅₆₇₈₉₊₋₌₍₎
¤¢$£€¥₡₢₣₤₦₧₨₭₮₫₥₯
.,:;?!‘'’‛‚“"”‟„/(‖)[¦]{|}\«»‹›¡¿․‧‥•·…‣~
*¶§&†‡@®™^+<=>×÷±μ-‐‒–—―_ ‗

àáâãäåāăąǎǟǡȧǻȁȃḁẚạảầấẩẫậắằẳẵặḃḅặćĉċčḉďḋḍ
ḏḑḓèéêëēĕėęěȅȩȇḕḗḙḛḝẹẻẽềếểễệḟĝğġģǧǵḡĥȟḣḥ
ḧḩḫẖìíîȉǐïįīịĩḭḯỉȋĭĵǰķǩḱḳḵĺļľḻŀḷḹḽḿṁṃñńņňʼnǹṅṇṉ
ṋòóôõöōŏőǒǫǭȍȏȫȭȯȱṍṏṑṓọỏồốổỗộớờởỡợṕṗŕŗ
řȑȓṙṛṝṟśŝşšșṡṣṥṧṩţťțṫṭṯṱẗùúûüũūŭůűųǔǖǘǚǜȕȗṳṵ
ṷṹṻụủứừửữựṽṿŵẁẃẅẇẉẘẋẍýÿŷȳẏẙỳỵỷỹźżžẑ
ẓẕǯǣǽǿẛ

Posted by: Pixy Misa at 09:40 PM | Comments (9) | Add Comment | Trackbacks (Suck)
Post contains 70 words, total size 3 kb.

Wednesday, July 25

Geek

New Light Through Old Windows

I think I'm there with the text effects library.

Opaque text with translucent shadow
/images/AnagramS.png

Translucent text with translucent shadow
/images/AnagramST.png

Translucent text with translucent shadow on an image
/images/AnagramSTbg.png

Tinted, translucent text with translucent shadow on an image
/images/AnagramSTCbg.png

The trick was preventing the shadow from showing through the translucent text.  The shadow isn't really a shadow; it's a set of blurred transparent diagonally-offset black copies of the text itself, so it extends under the text.  If the text is also transparent, that means that what shows through is a nasty grey mess rather than the image.

To fix that I had to create two images, one for the shadow and one for the text proper, plus an opaque mask with the same contour as the text so that when I composited the images the colour and opacity values of the text overwrote those of the shadow, so that when I composited that with the image, you got transparent text instead of blah.

And it actually worked.

I might still tweak the shadow settings a bit (or I can just expose those settings so that they're user-tweakable).  It looks fine on a solid colour but comes out a bit weird on some images.

And no, you can't see the examples from where I forgot to turn off the Gaussian blur on the text pass.

Posted by: Pixy Misa at 04:00 AM | No Comments | Add Comment | Trackbacks (Suck)
Post contains 226 words, total size 1 kb.

Tuesday, July 24

Geek

Drop The Shadows

Bum.

My drop shadows are only working on rectangles.  Hackity hackity...  Ah, there, that'll do for text:

/images/AirstreamS.png
/images/CopaseticS.png

Posted by: Pixy Misa at 07:16 PM | No Comments | Add Comment | Trackbacks (Suck)
Post contains 20 words, total size 1 kb.

Geek

Fontlery

Busy working on the theme builder thingy, and seeking fonts that are both attractive and under licenses that will let me use them for mee.nu.

Here are a few examples of fonts that make the cut in both respects:

/images/Airstream.png
/images/Anagram.png
/images/CameoAppearance.png
/images/Copasetic.png
/images/Creampuff.png
/images/FashionVictim.png
/images/Studebaker.png

These fonts appearing by permission of the very talented Nick Curtis with the aid of aggdraw.

Now, back to my masking and shading and transparencies and stuff.

Update: Link fixed.  Oops.

Posted by: Pixy Misa at 06:32 PM | Comments (1) | Add Comment | Trackbacks (Suck)
Post contains 71 words, total size 1 kb.

Monday, July 23

Geek

Reading The Docs

If omitted, or if the image has mode "1" or "P", it is set to NEAREST.
Doh!

When I put up the post about the Import module, I noticed that rescaling gifs on the fly with Minx looks like crap.  I tried fiddling with the settings, but it didn't help, because the image library ignores the frigging settings!

Well at least now I know what to do - convert it to RGB mode, then resize, then convert back to Palettised mode.

Meanwhile: Circle?  Circle?  You call that a circle?

Looks like I'll have to generate the mask at 2x or 4x and then scale down and anti-alias.

Dum de dum... Okay, now with 4xFSAA!  I wonder if that preserves the transparency settings...

Now all I need to do is work out how to do proper drop shadows, and I can do the entire banner generating thingy dynamically.

Aaaand: Dropshadows over solid colours: Check.  Now to tweak that to do dropshadows over images...

Got it!  Thank you ASPN and Google. smile

Update: Hrm.  I can see why this is not a common feature.  To get good results with curves I need to work at at least 4x the base resolution and then downsample, which means I'm working with 2 to 4 megapixel images; 8 to 16 mb of data each.  There's another library I can add which would let me do antialiased drawing; I may have to try that.  Meanwhile, I'll see what I can do with these fonts I've got here...

Update: Or I could try that library first.  Better.  Vertical as well as horizontal symmetry and without downsampling, so it's 10x faster.  Just need to tweak the radius of those corners up slightly.... Got it!   Now, er, can I use that as a mask?  Kind of pointless if not.  So let's give that a whirl.

Posted by: Pixy Misa at 06:32 PM | No Comments | Add Comment | Trackbacks (Suck)
Post contains 308 words, total size 2 kb.

<< Page 1 of 2 >>
77kb generated in CPU 0.034, elapsed 0.4988 seconds.
55 queries taking 0.4747 seconds, 369 records returned.
Powered by Minx 1.1.6c-pink.
Using https / https://ai.mee.nu / 367