Blog
Page: 0 ... 5 ... 10 ... 15 ... 20 21 22 23 24 25 26 27 28 29 ... 30 ... 35 ... 40 ... 45 ... 50 ... 55 ... 60 ... 65 ... 70 ... 75 ... 80
New i.Mage Scripting Functionality
Date: 17/9/2008
Every now and then I need to generate a directory of thumbnails from a set of photos. This is painful doing it by hand so in a moment of inspiration I thought that i.Mage could be scripted to do just that. (der!)

So with the addition of a few simple functions I came up with this little jem of a script:
f = SelectFiles(Parent, "Jpeg *.jpg", 0, 1);
if (f)
{
    for (i=0; i<f.Length; i++)
    {
        File = f[i];    
        Load(File);
        
        Doc = GetDocument();
        Print("Doc = " + Doc.x + "x" + Doc.y + " @ " + Doc.Bits + "\n");
        
        Aspect = 1.0 * Doc.x / Doc.y;
        Nx = 320;
        Ny = Nx / Aspect;
        Print("Aspect = " + Aspect + " " + Nx + "x" + Ny + "\n");
        
        Resample(Nx, Ny);
        
        Dot = Strchr(File, ".", -1, 1);
        Base = Substr(File, 0, Dot);
        Ext = Substr(File, Dot+1);
        Small = Base + "_s." + Ext;
        Print("Small=" + Small + "\n");
        
        Save(Small, "quality=40");
    }
}
It opens a file selection dialog at the top and then proceeds to convert each file down to 320 px across and saves it out to "filename_s.ext".

Then I got to thinking, that this could ship with the product and hang off a tools menu so that other people can use it too. Or at least it there needs to be a directory of scripts that you can access in the editor rather than just what you were working on last.

Hmmmm.

There is a new function GetDocument() that returns the current document (in the form of a GVariant containing a GSurface) which has a few properties like "x", "y" and "Bits". There is some new scripting abilities in the pipes to allow the engine to call methods on Dom objects. This could pave the way to code like:

GetDocument().Create(640, 480, 32);


Which would be quite nice. I've also started putting some of the standard image wide transforms into functions so that you can call them from scripts. i.e. the Resample() method.
(1) Comment | Add Comment

Lgi Release
Date: 12/9/2008
Someone once said that i.Hex didn't work on Cygwin/MingW, and I had a look at it, and sure enough it didn't. So anyway I fixed that and uploaded same current Lgi and i.Hex source, with makefiles that actually produce working binaries if you can find the various libs that Lgi relies on (iconv, libjpeg, libpng, zlib) and adjust your local paths accordingly. (Btw unzip both files into the same folder for best results)

I can't find that original post, so heres you're reply :)

Also included in the Lgi release is working project files for Visual C++ 2005/2008, if you're into that. Most of the API's are really stable at the moment. But I'm thinking of really messing with the GDom class to convert it to integer based naming instead of passing strings around. That would cause chaos in all the different apps because GDom is used everywhere now. The latest release has a few cool bits of new software in it, first the new bytecode compiler and VM, and also the updates to the IMAP protocol code thats being used in Scribe v2. Also the mac port inches along, so if you were thinking of building something on both windows and mac this release would actually work for you.

Full doxygen api docs are in ./docs/html so have a look at that if you want. I've been meaning to do some basic examples of Lgi application for a long time. But no one seems interested. If you are interesting in some samples let me know and I'll work some up.

Oh... and this is my 500th blog post. Go me. (Just because the ID is "511" doesn't mean anything... I deleted some apparently)
(0) Comments | Add Comment

Downgrading Back to Firefox 2.0.0.16
Date: 9/9/2008
Well I've done just that. Firefox 3 is just not stable enough for everyday use. For the first week it was fine, but more recently it crashes 5, 6, 8 or 12 times a day. I just got sick of that, especially considering that I use Firefox all the time and there isn't anything in v3 that I actually need or want.

Firefox 2 has always been rock solid and I'm happy with that.

Kinda like how a feel about Tiger and Leopard actually. Software reaches a peak, and I stick with that version till I'm absolutely forced to upgrade.

My primary developer platform is still Visual C++ v6 which is ancient by most standards. But still the best for what I do. It's laughable the having both v6 and 2008 express open at the same time and comparing the speed of the 2 versions. I don't have a slow machine but waiting 10 seconds for a project properties dialog to open is asking a lot.

Anyway is sad to see Firefox peak like this and slowly start it's gradual descent into the abyss, following it's parents Mozilla and Netscape Navigator no doubt.

Maybe some point release will return v3 to stability but I won't hold my breath.

Update: So today I get this:



Haha... "More awesome than ever." Tell me about the crashing, I want to hear about that. How that is more awesome than ever. Guess which button I clicked.

Btw, great horizontal scroll bar. That just makes it... more awesome.
(1) Comment | Add Comment

Visual C++ 2008 Express
Date: 4/9/2008
So I had reason to install Visual C++ 2008 Express today, mainly to compile some app that used SSE2 instructions in the inline assembly that Visual C++ 6 doesn't support. It's not like I'm changing religions.. *cough* I mean IDE versions or anything. Just compiling one app.

Anyway it took a right big ol steaming dump in my Firefox install didn't it. The .NET 3.5 installer without asking or warning in the least decides that it can install a Firefox add-on and modify the user agent string. Which is just wrong, WRONG, WRONG!. No Microsoft, you MAY NOT INSTALL ANY CRAP IN MY BROWSER FULLSTOP. No add-ons, no silverlight, no .NET no NOTHING.

So. Deep breath. Google will aid you. 2 quick searches later I have the uninstall instructions. Basically it comes done to this:
  1. Remove the "{20a82645-c095-46ed-80e3-08825760534b}" reg key in
    HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\Firefox\extensions
  2. Remove the folder
    C:\WINDOWS\Microsoft.NET\Framework\v3.5\Windows Presentation Foundation\DotNetAssistantExtension\
  3. Go into "about:config" in Firefox, search for this entry, right click on the entry and delete/clear it:
    general.useragent.extra.microsoftdotnet
  4. Restart Firefox and you're back to being clean.


Take a deep breath of fresh, Microsoft free, air.

;)
(4) Comments | Add Comment

Imap / Scribe v2
Date: 2/9/2008
After getting a gentle push to read the docs more carefully from the IMAP protocol mailing list guys I'm close to having an implementation that understand the BODYSTRUCTURE field such that it can be picky about which parts of the email's body to download. In the case that you have an email with a large attachment it seems obvious that the client downloads just the text/html part for display without immediately fetching the attachment. Well thats easier said than done. I've got some code now that extracts the body structure into a XML dom tree and I'm hoping to expose that to the UI layers in Scribe so that I can start picking which bits I need for display instead of fetching the entire body of the message. I'll have to synthesize similar functionality on the mail2 backend but that shouldn't be too much work. It's already half there with the attachments as separate child objects of the email.

However the whole caching model is taking longer than I anticipated to get running smoothly. I keep finding that email is falling through cracks or asserts firing, telling me that something couldn't be found when it really should be there. Clearly it's a non trivial piece of code.

Previously
(0) Comments | Add Comment

DVB → Mp4
Date: 2/9/2008
For a long time I've had a private stock app that manages encoding DVB mpeg2 to whatever compressed video format is in fashion. Which at the moment is H.264.

So anyway recently I started pushing HD through it and well it did not like that at all. Basically after much head scratching I worked out that avisynth, which serves up frames to x264 was "guessing" the length of the input mpeg2 file, or more correctly, one of the filters in it's direct show graph was doing the guess. Unfortunately, because Avisynth has to report an exact length of it's AVI at startup it means that the video stream is only ever as long as Avisynth's "guess". This is unacceptable, and there is only one route around this, and that is not to use direct show (i.e. DirectShowSource). So the option is using Mpeg2source filter plugin (oh no yet another dependency!). And that relies on an indexer to produce d2v indexes of the mpeg2 first. So now my graph looks like this:



This is a graphical editor for video processing blocks that I've been working on. Essentially the current system is a hardcoded version of this, but when I'm done, all the same functionality will be plug and play, probably with some scripting support as well.

This week I did finally get my mpeg parsing library up to snuff so that it can dump out all the meta data for a mpeg video stream (not PS/TS, just video at this stage) which is a good step forward. At the moment the mpeg2demux stage runs Pvastrumento which is the best error correcting demuxer available. However I'm about halfway to having a demuxer myself, and I suspect that I can create something that can compete with the error correcting capabilities of Pvastrumento and probably produce a d2v file in the process. So that would greatly simplify the whole diagram and get rid of that ungainly d2v indexing step.

Eventually I'll build up a library of components and graphs to handle the vast majority of media re-encoding needs and possibly release it as an application.
(0) Comments | Add Comment