[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-core-devel
Subject: Re: JPEG Thumbnailer
From: Andre_Gemünd <scroogie () gmail ! com>
Date: 2008-08-18 17:07:37
Message-ID: 48A9AC59.8040609 () gmail ! com
[Download RAW message or body]
Michael Pyne schrieb:
>
> Actually it's easier than that:
>
> On an opened QFile you can use QFile::handle() to return the file
> descriptor (i.e. what is passed to write(2)). Using the file
> descriptior you can use the C stdio fdopen() function to return a
> FILE* tied to that file descriptor.
>
> This way you can still use stdio functions on a file managed by QFile.
>
> All that this would really buy you is guaranteeing that the file gets
> closed, which may not be worth the overhead however if you're simply
> going to be passing the FILE* to libjpeg.
>
> Regards,
>
Hi Michael,
thanks a lot for you explanation. As I said, I'm not very experienced
with Qt/KDE programming yet, so your input is very appreciated.
How much overhead are we talking about? We are opening all jpeg files of
a directory which can be a lot at times, and apply a not-so-costly
operation, so we should take this into consideration. And you are right,
I just pass the FILE* to libjpeg and close it after
jpeg_finish_decompress(), so it doesn't seem very sensible to open it
twice (QFile and fdopen).
Greetings
André
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic