Trouble with gzipped files

Luis Pedro Coelho luis_pedro at netcabo.pt
Fri Jun 20 17:36:37 BST 2003


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Le Friday 20 June 2003 18:13, Lubos Lunak a écrit :
>  Hello,

Hi,

Thanks for posting this. I had thought about posting this here myself, but I 
was still hoping I might find a solution myselft before bothering anyone else 
:)

>  mimetypes wizard needed. Say that I have a couple of .ps.gz files, and
> when browsing them in Konqueror, I want to view them in KGhostview (this is
> actually from a user posting at a local newsgroup). 

This is also Bug 59856 { http://bugs.kde.org/show_bug.cgi?id=59856 }.

In that bug's small discussion, Thiago suggested assigning 
application/postscript; compression=gzip to *.ps.gz

This seems very logical, but I don't really know whether this corresponds to 
any convention used elsewhere. I tried look through the existing mimetype 
[Thiago, can you answer this? I am CCing you bc of this question].

>  First, for completeness, let's mention Ark. Some people may like it, but
> I'm among those that don't, and disable all its associations. Browsing
> directly in Konqy's standard iconview feels a lot better, not to mention
> things like doubleclicking a file actually does something, and viewing a
> HTML file loads the KHTML part.

I agree that Ark for something like .ps.gz (or .anything.gz) I sub-optimal if 
you can open .anything directly with an app.
Still, I think it's best not go that way in this discussion (whether ark is 
good or not and why). Let's keep it technical: what possibilities are there 
to at least allow the user to open .ps.gz in kghostview?

>  Second part: Since KGhostview can handle ps.gz itself, I could try to add
> *.ps.gz to as extension to the application/postscript mimetype. Now, after
> clicking on a .ps.gz file, I get KGhostview ... and KGhostview error.
> KGhostview uses "KFilterDev::deviceForFile( _fileName, _mimetype )" with
> _mimetype being "application/ghostscript", and that's the problem. The
> .ps.gz file is no longer considered gzip file, so this call will be
> basically a no-op.

<pedantic>I think it's application/postscript</pedantic>, but it comes to the 
same.

But, yes, that's what the code does. I have been thinking of just hardcoding

if ( _fileName =~ /.gz$/ )  deviceForFile( _fileName, "application/x-gzip" ) 
else if ( _fileName =~ /.bz2$/ ) deviceForFile (_fileName, 
"application/x-bzip")

but that is not very good, is it?
If no solution comes up, I will probably do just do that.

At first, I hoped that passing "application/postscript; compression=gzip" to 
deviceForFile would get me a gzip filter, but it doesn't seem to. I am not 
sure whether this is a bug or a feature.

I sometimes see posts about a mimetype hierarchy system, where I imagine one 
would have (in pseudo-OOP syntax)

namespace application { 
mimetype "x-gzip"
mimetype "postscript"
mimetype "postscript;compression=gzip" extends x-gzip, postscript
}

which seems to fit here, but I haven't seen anything concrete about this.

Thinking smaller, just allowing "application/postscript;compression=gzip" to 
find kghostview which offers "application/postscript, Application" and 
"application/postscript,Browser/View" and then inside the app, let it find 
the correct filter would be great. No apps would need much to handle 
compression, if that was the case.

This might have an impact on inter-desktop stuff, but I don't know anything 
about that [Waldo, are you reading this?].

Regards,
- -- 
Luis Pedro Coelho

The carrot tax, see:
http://luispedro.journalspace.com/

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE+8zgVGpBAvyRwXdgRAvmTAJ9VSiuj/Yd5DjJ2wRLA22gD77R70QCff4IU
4PESl3L0eK+1y7vF/is+LHk=
=on0p
-----END PGP SIGNATURE-----




More information about the kde-core-devel mailing list