Archive for the ‘Uncategorized’ Category

Imagemagick: Pdf to bitmap density quirk

When converting bitmapcontained pdfs to bitmaps using the imagemagick convert method, beware the parameter order! The density parameter sets the resolution of the bitmap conversion before resizing – therefore, the higher density value, the better resulting quality.
So, the followning should work, but doesnt:

convert source.pdf -resize 630×891 -density 300 result%04d.png

By some reason the -density parameter has to be set before the source file name. This works:

convert -resize 630×891 -density 300 source.pdf result%04d.png

By the way, the “%04d” tag in the resulting file name gives an autonumbering with leading zeros, in this case 4 digits in total. Thus:

page0000.png
page0001.png
page0002.png

etc.

Eclipse plugin of tomorrow? nWire for php

Just tried a beta of the comin nWire plugin for php in Eclipse PDT/Zend Studio. It brings super-handy code exploration, including graphical tree view of includes and method dependencies, to php environment.

Right now it works in Eclipse 3.5, not in my 3.3 environment, so I have to make some change in my FlexBuilder based Eclipse-setup before it can be a tool for me…

Not free, but 59 bucks for a personal license is nothing to grumble about.

Php: Creating an uncompressed zip archive

Such a trivial task! Just use one of the included php libraries..? No. After some hours googling, good old PEAR got me closer. The late Pear Archive_Zip has a ‘no_compression’ parameter option. So, does it work? No. Corrupt content.After some further investigation, I found a reported bug adressing this matter. And a solution! :-)

Archives become corrupted when use packing with ‘no_comopresson’ option set to ‘true’. I solved the promlem by changing

$p_header['compression'] = 8; to $p_header['compression'] = ($p_params['no_compression'] ? 0 : 8);

in ‘zip.php’ file on line 1429.

Thank you, Kotusev!

Posting source code at wordpress.com

Just posted my first source code example. I had to fiddle around a bit to get it to work.
The snippet shoud be wrapped in a sourcecode tag, like this:

 // or 'php', 'java', 'xml'...
... code ...

For avoiding span tags automatically inserted by the editor, it’s safest to paste the wrapping sourcecode tag, including the code snippet, in the editor HTML mode.

class TestService
{
    /**
     * @return Group
     */
    public function getGroup()
    {
        $group = new Group();

       	$person = new Person();
        $person->name = "Annah";
		$group->persons[] = $person;

        return $group;
    }
}

Thanks to Joeren Plumier’s blog!’

Cambiatablog premiere!

Welcome to Cambiatablog!

This might become a blog focused on programming and music notation. We’ll see. Don’t hold your breath…