AWARE [SYSTEMS] Imaging expertise for the Delphi developer
AWare Systems, Imaging expertise for the Delphi developer, Home TIFF and LibTiff Mailing List Archive

LibTiff Mailing List

TIFF and LibTiff Mailing List Archive
January 2009

Previous Thread
Next Thread

Previous by Thread
Next by Thread

Previous by Date
Next by Date

Contact

The TIFF Mailing List Homepage
This list is run by Frank Warmerdam
Archive maintained by AWare Systems



Valid HTML 4.01!



Thread

2009.01.06 08:49 "How to delete a TIFF image from a Mulit-TIFF file efficiently", by Mark Pereira
2009.01.06 10:35 "Re: How to delete a TIFF image from a Mulit-TIFF file efficiently", by Gerben Vos
2009.01.06 11:04 "Re: How to delete a TIFF image from a Mulit-TIFF file efficiently", by Mark Pereira

2009.01.06 11:04 "Re: How to delete a TIFF image from a Mulit-TIFF file efficiently", by Mark Pereira

Hi Rob,

Thanks for the information. I need to remove the TIFF image that is deleted.

I tried using tiffcp as follows:

int main(int argc, char* argv[])
{
        TIFF* in = TIFFOpen (argv[1], "r");
        TIFF* out = TIFFOpen (argv[2], "w");

        do {
 
          if (current image is not be deleted) then {
                tiffcp(in, out);
                TIFFWriteDirectory(out);
           }
    }
    while (TIFFReadDirectory(in));

    TIFFClose(out);
}

It works fine but its not linear and seems have complexity O(N x N).

I ran gprof and most of the time is spent in TIFFLinkDirectory(). Seems 
like each time TIFFWriteDirectory() is called all the directory entries 
are traversed to link the last directory that is written and sort of 
explains the non linear behavior.

Please comment on this analysis. Is there any way in which this linking 
can be done more efficiently.

Mark

rob.tillaart@chello.nl wrote:
> Hi Mark,
>
> A Multipage TIFF is a chain of images linked to each other. The most time
> efficient way to delete an image is get them out of the list. To do this
> one must change the "pointer" to the image to the one that's next in the
> file.
>
> In pseudo code: previous_image.next = to_be_deleted_image.next
>
> This is very fast but the complete image with all tags is kept in the
> file, increasing the slack%. 
>  
> sofar my 2 cents,
> rob tillaart
>
> ---- Mark Pereira <mark@softjin.com> schreef:
>   
>> Hi,
>>
>> I would like to know an efficient way of deleting a TIFF image from a 
>> Multi-TIFF file?
>>
>> Currently I am doing a tiffsplit followed by a merge (tiffcp). This 
>> works fine but its extremely in-efficient
>>
>> Thanks,
>> Mark
>>     
>
>
>   



Business Disclaimer
____________________________________________________________
This e-mail message and any files transmitted with it are intended solely
for  the use  of the  individual or entity  to which they  are  addressed.
It
may  contain confidential,  proprietary or legally  privileged  information.
If  you  are  not  the  intended recipient please be advised that you have
received  this  message in error and any use is strictly prohibited. Please
immediately  delete it  and all copies of it from your system, destroy any
hard  copies  of  it and  notify  the  sender  by return mail. You must not,
directly or indirectly, use,  disclose,  distribute, print, or copy any part
of
this message if you are not the intended recipient.
___________________________________________________________