Re: mng_write() and large file (was: mng_display_gotime() and large files)
"Gerard Juyn" <gjuyn-qWit8jRvyhVmR6Xm/[email protected]> Tue, 27 Jul 2004 09:49:46 +0200
| Newsgroups | gmane.comp.graphics.mng.general |
|---|---|
| Message-ID | <4106253A.17157.3AF41A@localhost> |
> mng_bool my_readdata(mng_handle mng, mng_ptr buffer,
> mng_uint32 size, mng_uint32 *bytesread)
> {
> *bytesread = fread(buffer, 1, size, mymng->file);
>
> // read IHDR chunk ?
> if (strstr((char*) buffer, "IHDR"))
> {
> if (need_rewind)
> {
> fseek(mymng->file, requisite_ihdr_filepos, SEEK_SET);
> *bytesread = fread(buffer, 1, size, mymng->file);
> }
> }
>
> return MNG_TRUE;
> }
>
> Although this works for my task, yet it's not universal :-(.
Well. That'll do the trick.
> But then i have other problem with mng_write() and large files.
>
> All chunks store in memory, and at the end write once on disk.
> I think, what it is not correct, because if file is large... :-). Can
> i write chunks immediately after putchunk() ?
>
> Now i have few patches for libmng-1.0.7, which allow this.
> Please, see them. May be possible include their in the libmng
> distribution?
Sure. I'll have a look this week.
--
Send the message body "help" to [email protected]