Giter Club home page Giter Club logo

Comments (9)

rmorejon avatar rmorejon commented on June 11, 2024
        using (Tiff input = Tiff.Open(@"D:\1.tif", "a"))
        {
            input.SetDirectory(0);
           input.SetField(TiffTag.ORIENTATION, BitMiracle.LibTiff.Classic.Orientation.BOTLEFT);
            input.RewriteDirectory();
         }

Work!!!

but I need use
using (Tiff input = Tiff.ClientOpen("in-memory", "a", stream, new TiffStream()))

it does not work

from libtiff.net.

Bobrovsky avatar Bobrovsky commented on June 11, 2024

Please clarify what does "no working !!!" means.

from libtiff.net.

rmorejon avatar rmorejon commented on June 11, 2024

var stream = new MemoryStream(File.ReadAllBytes(@"D:\1.tif"));
using (Tiff input = Tiff.ClientOpen("in-memory", "a", stream, new TiffStream()))
{
input.SetDirectory(0);
var result=input.SetField(TiffTag.ORIENTATION, BitMiracle.LibTiff.Classic.Orientation.RIGHTBOT);
input.RewriteDirectory();
}

In this case the field ORIENTATION no save correctly
Open the tiff with irfanView, the image no show rotated

But use

using (Tiff input = Tiff.Open(@"D:\1.tif", "a"))
{
input.SetDirectory(0);
input.SetField(TiffTag.ORIENTATION, BitMiracle.LibTiff.Classic.Orientation.BOTLEFT);
input.RewriteDirectory();
}
works correctly !!!

I need to use the variant Tiff input = Tiff.ClientOpen("in-memory", "a", stream, new TiffStream())
because I have the memory tiff

from libtiff.net.

Bobrovsky avatar Bobrovsky commented on June 11, 2024

Please note that you use different values for TiffTag.ORIENTATION in the first and the second cases.

Please also note that the first code block affects memory stream only and you should save the memory stream into a file.

from libtiff.net.

Bobrovsky avatar Bobrovsky commented on June 11, 2024

Please also note that you create non-expandable memory stream.

from libtiff.net.

rmorejon avatar rmorejon commented on June 11, 2024

what I want is to change the orientation field of a tiff because rotate the image. I have the tiff loaded into memory, then when I finish the album except pa verify

from libtiff.net.

rmorejon avatar rmorejon commented on June 11, 2024

Help me ?

from libtiff.net.

jaydeep6720 avatar jaydeep6720 commented on June 11, 2024

`using (Tiff input = Tiff.Open(@"D:\TRIAL DESIGNS\ROTARY\01.tif", "a"))
{

            input.SetDirectory(0);
            int width = input.GetField(TiffTag.IMAGEWIDTH)[0].ToInt();
            int height = input.GetField(TiffTag.IMAGELENGTH)[0].ToInt();

            input.SetField(TiffTag.ORIENTATION, BitMiracle.LibTiff.Classic.Orientation.BOTLEFT);
            input.SetField(TiffTag.EXIF_PIXELXDIMENSION,height);
            input.SetField(TiffTag.EXIF_PIXELYDIMENSION,width);
            input.RewriteDirectory();
            input.Close();
        }`

I am Using this Code to rotate Image. Operation Successful & also visible in Irfan View. But when I load it in CYOTEK picture box Or Default picture box it doesn't reflects the rotation of Image.

from libtiff.net.

makingbloke avatar makingbloke commented on June 11, 2024

from libtiff.net.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.