Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7848613
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T18:16:06+00:00 2026-06-02T18:16:06+00:00

I am trying to update certain tiff tag value using the GDAL python binding.

  • 0

I am trying to update certain tiff tag value using the GDAL python binding.

for example, using tiffinfo I can read the tags value from the image, it is something like this:

TIFF Directory at offset 0x8 (8)
Image Width: 4172 Image Length: 3689
Tile Width: 256 Tile Length: 256
Bits/Sample: 8
Sample Format: unsigned integer
Compression Scheme: JPEG
Photometric Interpretation: YCbCr
Samples/Pixel: 3
Planar Configuration: single image plane
Tag 33550: 60.000000,60.000000,0.000000
Tag 33922: 0.000000,0.000000,0.000000,588840.000000,4880460.000000,0.000000
Tag 34735: 1,1,0,7,1024,0,1,1,1025,0,1,1,1026,34737,22,0,2049,34737,7,22,2054,0,1,9102,3072,0,1,32618,3076,0,1,9001

I want to update “Tag 33922” with a different value without saving a new image.
But I couldn’t find a method to update the tag value in the GDAL python API.

Did I miss something or this is just simply not supported in GDAL python binding?

Thanks
Jie

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T18:16:09+00:00Added an answer on June 2, 2026 at 6:16 pm

    Thanks cgohlke for showing me the libtiff wrapper in python. I ended up writing C# code using the LibTiff.Net API. It looks something like this:

    using (Tiff image = Tiff.Open(filePaths[i], "a"))
    {        
        image.SetDirectory(0);
    
        // read auto-registered tag 33922
        FieldValue[] value = image.GetField((TiffTag)33922);
        int count = value[0].ToInt();
        double[] array = value[1].ToDoubleArray();
        System.Console.Out.WriteLine("Tag 33922 value(s) are as follows:");
        System.Console.Out.WriteLine(string.Join(",", array));
    
        double[] newarray = { 0.5, 0.5, 0, array[3], array[4], array[5] };
        image.SetField((TiffTag)33922, 6, newarray);
    
        System.Console.Out.WriteLine("Tag 33922 value(s) have been updated to:");
        System.Console.Out.WriteLine(string.Join(",", newarray));
    
        // Write the information to the file
        image.CheckpointDirectory();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to update row in a table using values from a different row
Problem: I am trying to update a List. If a certain item's ID already
Possible Duplicate: before_filter :require_owner I am trying to restrict access to certain actions using
I am trying to update certain pieces of data based on a select statement
I am trying to access and update certain attributes of an element in a
I am trying to update as well as save data to my database using
I'm trying to make an array, and then update the values of certain cells
I'm trying to record DELETE statements in a certain table using Oracle's auditing features.
I'm trying to update certain controls according to a selection in a dropdown list.
I am trying to run a simple Update query on a certain set of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.