From: Tom G. <to...@li...> - 2000-10-29 23:04:47
|
* ra...@ra... (ra...@ra...) wrote: > On 29 Oct, Tom Gilbert scribbled: > -> Not necessarily. I am thinking of simple little apps that grab a > -> filename from the user and then just imlib_save_image(filename); and = let > -> imlib do the rest. With each loader having different shit you add a > -> layer of complexity. They have to parse the filename, determine filet= ype > -> and do the right thing. I don't mind personally, but it just seems ni= cer > -> to keep them all the same - somehow..... >=20 > truye - but to save as a file type they have to parse the filename > anyway for ythe output type(ie look at the extension) so they alreayd > knwo the file type- and they knwo for certain formats certainoptions > are suported etc. (ie quality for jpeg, compression for png and db) They do? Hrm. let me give you an example. Here's what scrot does right now: [... some stuff to grab the screenshot as an Imlib_Image ] imlib_context_set_image(image); imlib_image_attach_data_value("quality", NULL, opt.quality, NULL); imlib_save_image_with_error_return(opt.output_file, &err); [... check for errors ] Done. Nice and simple. If the user runs "scrot shot.png" he gets a png. If he does "scrot shot.jpg" he gets a jpeg. I didn't need to parse anything, and I like that ;-) Now I know you are thinking of apps like gimp where there is a plethora of options, all file-type dependant. But in this case, it would be really nice to be able to set "quality" or "compression" and know the Right Thing will be done. I don't really want to write code to chop up what they selected and do the right thing. ALSO, imlib2's savers are modular, people could write savers separate from imlib2 that I don't know about (eg xcf loader). I haven't a clue what options that takes, and if someone writes a new one in 4 months and sticks it on Freshmeat, how am I supposed to deal with that? Surely it is better for loaders to take a standard set of tags, "compression", "interlace" etc, and either do the Right Thing or ignore tags they don't support? Then I don't have to update all my imlib2 apps (and everyone else) when someone finally writes an SVG loader :-) Tom. --=20 .^. .-------------------------------------------------------. /V\ | Tom Gilbert, London, England | http://linuxbrit.co.uk | /( )\ | Open Source hacker, advocate | to...@li... | ^^-^^ '-------------------------------------------------------' |