bug-gnubg
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-gnubg] PNG Export


From: Joern Thyssen
Subject: Re: [Bug-gnubg] PNG Export
Date: Sat, 28 Dec 2002 14:21:53 +0000
User-agent: Mutt/1.4i

On Sat, Dec 28, 2002 at 11:40:05AM -0200, Albert Silver wrote
> 
> 
> -----Original Message-----
> From: address@hidden
> [mailto:address@hidden On Behalf Of Jim
> Segrave
> Sent: Saturday, December 28, 2002 10:24 AM
> To: Albert Silver
> Cc: 'Joern Thyssen'; 'GNUBackgammon bug reporting'; 'Øystein Johansen'
> Subject: Re: [Bug-gnubg] PNG Export
> 
> On Sat 28 Dec 2002 (10:22 -0200), Albert Silver wrote:
> >> 
> >> This is completely different unless you are saying someone creating a
> >> PNG image might want to save it with a different extension??
> >> 
> 
> 
> >Sure - why not? I can think of lots of times where I might want to do
> this.
> 
> Such as? I really can't think of a practical example. My view of it is
> that out of 100 users (for example) who might use this feature, they
> will ALL be using it to stick in a document for either web publishing or
> a Word-type document for print or viewing. In none of those cases, can I
> imagine the user wanting the PNG diagram to not have the correct
> extension, since in Windows the image would be unusable without it.
> Perhaps I'm missing something.

I tried a few image manipulation programs on my linux box, and none of
them care what the extension is.  I can call my PNG picture for xxx.gif
and GIMP or ImageMagick will still open it correctly. 

".mng" might be a valid extension for a PNG file?!

On unix systems programs often use the first bytes of a file to
determine the format (the so-called magic bytes), so the extension is
arbitrary. For example, a PNG image always start with hex 0x89 followed
by the string "PNG" followed by hexs 0x0D 0x0A 0x1A 0x0A. This uniquely
identifies a PNG picture, not what arbitrary extension somebody chose
for the file.

I don't think PNG is the best example because you would rarely want to
change the default extension to something different than PNG. 

I think it would be very inconsistent to add a default extension when
saving PNG images, but not elsewhere. So if we decide to it for PNG, we
should do it everywhere (in my opinion)!

However, most of the files produced and read by gnubg are text files,
for which you can chose among several possible extensions.  For example,
HTML files might be called .htm instead of .html, or someone might even
call them .xml or .xhtml as the exported files are valid XML. Similar
for Jellyfish .mat export where .mat, .txt or .text are valid choices.

So if we decide to implement some for of automatic extension then we
allow for several possible extensions for each format. If a user wants
to export html to filename 'fred', we change it to 'fred.html', but we
should accept 'fred.xml', 'fred.htm', 'fred.xhtml', 'fred.shtml',
'fred.sht', 'fred.xht' (and possibly others) as "legal" filenames.

If we make it an option, we can make it default on wintendo and not on
unix.

Jørn



reply via email to

[Prev in Thread] Current Thread [Next in Thread]