2003.04.29 16:12 "Newbie Question (StripOffsets/StripByteCount)", by Harring Figueiredo

2003.04.29 19:51 "RE: Newbie Question (StripOffsets/StripByteCount)", by John Carter

Hi Harring

I think I'm right in making a correction to your condition. I think it should be ( count * size_of_type >= 4) rather than ( count * size_of_type > 4)

I made that mistake too, and it took me a while to spot it.

also (on slightly related point)
don't forget to cast the ifd_entry.value_offset
such as compression below, switching on ifd_entry.value_offset
directly can give you some strange results.

                case COMPRESSION:
                       tiff_data->compression = (TIFF_SHORT)ifd_entry.value_offset;
                    if(DEBUG&LOAD_PAGE_DEBUG){
                              printf("COMPRESSION:\n");
                               switch(tiff_data->compression){
                                 case 1:
                                         printf("        Image is not compressed\n");
                                            break;
                                  case 2:
                                         printf("        Uses 1d Huffman run length encoding\n");
                                                break;
                                  case 3:
                                         printf("        T4 Bilevel compression\n");
                                             break;
                                  case 4:
                                         printf("        T6 Bilevel compression\n");
                                             break;
                                  case 5:
                                         printf("        LZW compression\n");
                                            break;
                                  case 6:
                                         printf("        JPEG compression\n");
                                           break;
                                  case 32773:
                                             printf("        PackBits on Raster image data\n");
                                              break;
                                  default:
                                                printf("        No case for compression type %d\n",
                                                             ifd_entry.value_offset);
                                                printf("        in file %s %d\n",__FILE__,__LINE__);
                                            break;
                          }
                       }
                       break;