User talk:Malvineous

Hi, was wondering if you could help me with an extension I'm working on (as your Extension:FlvHandler seems to be the only extension I've seen using ImageBeforeProduceHTML hooks successfully, and that's where I have a problem). I'm trying to make the wiki display XCF images as multipage-documents. Now, my webserver is already configured such that requesting /images/f/f5/imagename.xcf/layername.png will pull a layer out of an XCF file; I've written an ImageBeforeProduceHTML function which generates javascript to request all the layers and display them as a stack. But I can't figure out how to force this to be called ... including an just gives me a text link to File:filename.xcf, and my hook function isn't called.

Do I need to implement the ImageHandler too? I can't seem to find any comprehensible documentation on that class, so any help would be much appreciated. -- 81.151.233.20 17:25, 23 May 2011 (UTC)


 * Hmm, it has been a while since I looked at this. I think ImageBeforeProduceHTML is only called before an tag is generated - so if you get a (red) text link to File::filename.xcf there would be no tag, and hence no call to ImageBeforeProduceHTML.  I would guess that yes, you do need to implement an ImageHandler.  This might not be such a bad thing, as it would mean you can then use .xcf files in other places (e.g. image galleries) if you make your ImageHandler generate a thumbnail.  Or you could take the easy way out and make the ImageHandler generate a blank image so that ImageBeforeProduceHTML will be called, but the .xcf file will just appear as a blank image if it's used somewhere else (e.g. actually visiting the uploaded file's preview page.) -- Malvineous 22:36, 23 May 2011 (UTC)


 * Thanks, I was guessing it'd be something like that. I'll have to try and get my head around ImageHandler I guess ... but it seems like an awful lot of extra effort (do you know if there's some way to just output the URI of the actual image as blah.xcf.png instead of blah.xcf and let mod_conversion handle the actual image processing?)
 * Or maybe I'd be better off using the ImageHandler from Extension:Xcf ... only just found that.
 * Many thanks -- 62.49.26.154 14:28, 24 May 2011 (UTC)


 * Well, still working on this ... I'm not sure what methods are missing from my ImageHandler class, and I can't find any coherent documentation on it. Did you have some? I've implemented every part I can understand, but [[Image:blah.xcf]] on any page still gets rendered as a (blue) text link to File:blah.xcf; and the thumbnail on the image page is still the "blank page" icon it used for unknown filetypes. I've tried inserting breadcrumbs (statements that log to a db table) in both the ImageBeforeProduceHTML hook, and all over the ImageHandler class, and none of my methods are even being called. I'm completely clueless here -- 90.215.170.74 21:34, 4 June 2011 (UTC)


 * It's difficult to say what the problem is without seeing the code. Perhaps you're not registering the hook correctly, so MediaWiki doesn't know it is supposed to call your code?  I didn't end up using any documentation, I just looked at the SVG handler that comes with MediaWiki and copied what I needed from there.  FlvHandler is probably a bit simpler, so all I can suggest is comparing your code against FlvHandler (particularly the part where it registers all the classes with the core code) to make sure you haven't omitted any steps. -- Malvineous 00:28, 5 June 2011 (UTC)

MassEditRegex
Hey Malvineous. Please look at Extension_talk:MassEditRegex. Regards, SVG 09:39, 2 August 2011 (UTC)