How I can use the ImageSharp to convert Tiff to Jpeg? #2885
Unanswered
mugedegerliyurt
asked this question in
Q&A
Replies: 2 comments 1 reply
-
I have no idea what you are actually asking? What is failing? You should be able to decode a TIFF and encode in any of the available formats. |
Beta Was this translation helpful? Give feedback.
0 replies
-
The |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am trying to convert Tiff to Jpeg by using ImageSharp library, but I am having problem with the code part:
Subsample = JpegSubsample.Ratio444, // No chroma subsampling for highest quality
IgnoreMetadata = true // Strips all metadata
since it is not supported with the current version. Could you please help me how I can handle the problem? Thank you!
using System;
using System.IO;
using SixLabors.ImageSharp;
using SixLabors.ImageSharp.Processing;
using SixLabors.ImageSharp.Formats.Jpeg;
using SixLabors.ImageSharp.PixelFormats;
public class TiffToJpegConverter
{
public static void ConvertTiffToJpeg(string inputPath, string outputPath)
{
try
{
using (Image image = Image.Load(inputPath)) // Ensures image is loaded as RGB24
{
// Auto-orient to correct rotation
image.Mutate(x => x.AutoOrient());
}
Beta Was this translation helpful? Give feedback.
All reactions