Skip to content

Comments

[WIP] Add method to process multipage tiff page wise#74

Merged
Sicos1977 merged 1 commit intomasterfrom
copilot/fix-972f6a85-57de-4362-8ae0-6f9cdc9ffb6b
Oct 1, 2025
Merged

[WIP] Add method to process multipage tiff page wise#74
Sicos1977 merged 1 commit intomasterfrom
copilot/fix-972f6a85-57de-4362-8ae0-6f9cdc9ffb6b

Conversation

Copy link
Contributor

Copilot AI commented Oct 1, 2025

Thanks for assigning this issue to me. I'm starting to work on it and will keep this PR's description up to date as I form a plan and make progress.

Original issue description:

Hello,

This is really helpful implementation as it keeps updating new tesseract versions.

Please add method in Image.cs class that overrides PixArray process and process tiff files page wise for multipage tiff files from file.
public static Image LoadTiffPageFromFile(string filename, int pageIndex)
{
Logger.LogInformation($"Loading TIFF page {pageIndex} from file '{filename}'");

var pixHandle = LeptonicaApi.Native.pixReadTiff(filename, pageIndex);

if (pixHandle == IntPtr.Zero)
{
    string message = $"Failed to load page {pageIndex} from '{filename}'";
    Logger.LogError(message);
    throw new IOException(message);
}

var img = Create(pixHandle);
img.ImageName = $"{filename}[{pageIndex}]";

Logger.LogInformation("TIFF page loaded");
return img;

}

Original prompt

This section details on the original issue you should resolve

<issue_title>Add method to process multipage tiff page wise</issue_title>
<issue_description>Hello,

This is really helpful implementation as it keeps updating new tesseract versions.

Please add method in Image.cs class that overrides PixArray process and process tiff files page wise for multipage tiff files from file.
public static Image LoadTiffPageFromFile(string filename, int pageIndex)
{
Logger.LogInformation($"Loading TIFF page {pageIndex} from file '{filename}'");

var pixHandle = LeptonicaApi.Native.pixReadTiff(filename, pageIndex);

if (pixHandle == IntPtr.Zero)
{
    string message = $"Failed to load page {pageIndex} from '{filename}'";
    Logger.LogError(message);
    throw new IOException(message);
}

var img = Create(pixHandle);
img.ImageName = $"{filename}[{pageIndex}]";

Logger.LogInformation("TIFF page loaded");
return img;

}</issue_description>

Comments on the Issue (you are @copilot in this section)

Fixes #73

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@Sicos1977 Sicos1977 marked this pull request as ready for review October 1, 2025 08:38
@Sicos1977 Sicos1977 merged commit 764657a into master Oct 1, 2025
1 check failed
Copilot AI requested a review from Sicos1977 October 1, 2025 08:38
@Sicos1977 Sicos1977 deleted the copilot/fix-972f6a85-57de-4362-8ae0-6f9cdc9ffb6b branch October 1, 2025 08:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add method to process multipage tiff page wise

2 participants