Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Images examples in pdf-toolbox fails to find the images #1110

Closed
jabhatfield opened this issue Mar 22, 2024 · 1 comment · Fixed by #1111
Closed

Images examples in pdf-toolbox fails to find the images #1110

jabhatfield opened this issue Mar 22, 2024 · 1 comment · Fixed by #1111

Comments

@jabhatfield
Copy link

Images examples in pdf-toolbox fails to find the images.

To Reproduce

  1. Run Images in pdf-toolbox
  2. The following error occurs: /Users/<my-username>/IdeaProjects/OpenPDF/otsoe.jpg (No such file or directory)

Expected behavior

The example should run without error messages and Images.pdf should contain the intended images.

System

  • OS: macOS 14.2.1

Additional context

The example should read from the classpath instead of attempting to read copies of images placed in Java packages. I have a forked branch with a fix and will create a PR.

This is part of a more widespread problem in pdf-toolbox:

  • There are approx. 20 other references to otsoe.jog in pdf-toolbox examples, also failing to find the image e.g. SoftMask and Rotating
  • 5 duplicates of otsoe.jog are scattered around e.g. the package containing CellEvents has a copy of it (which CellEvents fails to find)

The same problems are present for other examples and other images e.g.:

  • ImagesAlignment fails to find vonnegut.gif

It's probably best to fix this problem one step at a time? I would suggest adding my fix for Images first then follow the same pattern in subsequent issues:

  • Move the images to src/test/resources
  • Delete duplicates
  • Update the pdf-toolbox examples to use the new util method that reads from the classpath
@jabhatfield
Copy link
Author

PR created: #1111

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants