Skip to content

Commit

Permalink
Doc Import errors
Browse files Browse the repository at this point in the history
  • Loading branch information
JesusFileto committed Nov 13, 2024
1 parent 3d7dacb commit 3c85a96
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion libs/chonky/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ The library relies on common Rust tools as configured in the repository root. Th

## Usage

To run this package, a compiled static library of `pdfium-render` must be provided. The library should be held in `libs/pdfium-lib` folder in the `Chonky` package, the precompiled binary for MacOS has been included in this repo. We pass the environment variable of the full path of the libary once when running `cargo build`
To run this package, a compiled static library of `pdfium-render` must be provided. The library should be held in `libs/pdfium-lib` folder in the `Chonky` package, the precompiled binary for `MacOS` has been included in this repo. We pass the environment variable of the full path of the libary once when running `cargo build`

```sh
PDFIUM_STATIC_LIB_PATH=/path/to/static/lib cargo build
Expand Down
9 changes: 5 additions & 4 deletions libs/chonky/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,9 @@ pub mod pdf_segmentation {
///
/// # Errors
///
/// Return an [`PdfiumError::ImageError`] if there was a problem with the image processing
/// operation, occurs when image cannot be encoded into specific image format
/// Return an [`ChonkyError::Pdfium`] if there was a
/// problem with the image processing operation, occurs when image cannot be encoded into
/// specific image format
pub fn pdf_to_images(pdf: &PdfDocument) -> Result<Vec<DynamicImage>, Report<ChonkyError>> {
let mut images: Vec<DynamicImage> = Vec::new();

Expand Down Expand Up @@ -100,7 +101,7 @@ pub mod pdf_segmentation {
///
/// # Errors
///
/// Return an [`PdfiumError::CoordinateConversionFunctionIndicatedError`] if there was a problem
/// Return an [`ChonkyError::Pdfium`] if there was a problem
/// with converting the pdfs dimensions to pixels
fn create_empty_bitmap<'a>(
pdf: &'a PdfDocument,
Expand Down Expand Up @@ -153,7 +154,7 @@ pub mod pdf_segmentation {
///
/// Errors#
///
/// [`PdfiumError::ImageError`] when the image had an error being processed
/// [`ChonkyError::Pdfium`] when the image had an error being processed
fn as_image(bitmap: &PdfBitmap) -> Result<DynamicImage, Report<ChonkyError>> {
let bytes = bitmap.as_rgba_bytes();

Expand Down

0 comments on commit 3c85a96

Please sign in to comment.