• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

read tiff file and identify it's compression type using c++ (photoshop SDK)

Community Beginner ,
Mar 04, 2019 Mar 04, 2019

Copy link to clipboard

Copied

Can any let me know how to read a tiff file and identify it's compression mode (LZW, JPEG, etc..) using photoshop sdk c++?

Views

1.8K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Mar 06, 2019 Mar 06, 2019

Copy link to clipboard

Copied

I believe a TIFF file can have multiple images in it. And a PSD (Photoshop file) has a tag for TIFF for all the interesting things.

https://www.itu.int/itudoc/itu-t/com16/tiff-fx/docs/tiff6.pdf

Adobe Photoshop File Formats Specification

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Mar 06, 2019 Mar 06, 2019

Copy link to clipboard

Copied

I am able to get the compression type form the meta data. which i'm currently doing. But there are cases where the meta data is not populated with this information, for e.g. If i export an art as tiff from Illustrator and open the file in photoshop the metadata is not populated with the compression type. So in order to get this info i need to save the document again in photoshop and open the saved image for processing. So I am wondering if i have any c API to retrieve the compression type, then i can have one less problem.

So Can some one post some ways to get image compression type using PSD c++ API.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 09, 2019 Mar 09, 2019

Copy link to clipboard

Copied

Check out libtiff.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 28, 2023 Nov 28, 2023

Copy link to clipboard

Copied

LATEST

Checks the compression of tif.

void checkCompression(TIFF* tif) {
    uint16_t compression;
    TIFFGetField(tif, TIFFTAG_COMPRESSION, &compression);

    const TIFFCodec* codec = TIFFFindCODEC(compression);
    if (codec != NULL) {
        printf("Codec for compression method %u is %s\n", compression, codec->name);
    } else {
        printf("Codec for compression method %u not found\n", compression);
    }
}

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines