JThumbnail

JThumbnail is a Java library for creating Thumbnails of common types of file including .doc, .docx, .pdf , .mp4 etc. full list

Project Source: https://github.com/makbn/JThumbnail

How to use

String[] args = new String[]{};

JThumbnailer jThumbnailer = JThumbnailerStarter.init(args);

File in = new File("/inputFile.docx");

ThumbnailCandidate candidate = new ThumbnailCandidate(in,"unique_code");

jThumbnailer.run(candidate, new ThumbnailListener() {
     @Override
     public void onThumbnailReady(String hash, File thumbnail) {
        Files.copy(thumbnail.toPath(), Path.of("my_thumbnail_folder", thumbnail.getName()), StandardCopyOption.REPLACE_EXISTING);
     }

     @Override
     public void onThumbnailFailed(String hash, String message, int code) {
        // handle the situation
     }
});

// close thumbnailer
jThumbnailer.close();

Configuration Args

| Configuration Args | Description | | —————————————– | ——————————————————————- | | OPENAPI Properties | | | JTHUMBNAILER_OPENAPI_NAME | Application name, e.g. Java Thumbnail Generator in Swagger UI | | JTHUMBNAILER_OPENAPI_DESC | Description of the application in Swagger UI | | JTHUMBNAILER_OPENAPI_LICENSE | License of the application as displayed in Swagger UI | | JTHUMBNAILER_OPENAPI_URL | URL pointing to the license text for Swagger UI | | OPENOFFICE Properties | | | JTHUMBNAILER_OPENOFFICE_PORTS | Ports used by OpenOffice for document conversion | | JTHUMBNAILER_OPENOFFICE_TIMEOUT | Timeout for OpenOffice document conversion tasks | | JTHUMBNAILER_OPENOFFICE_MAX_TASKS_PER_PROCESS | Maximum number of conversion tasks allowed per OpenOffice process | | JTHUMBNAILER_OPENOFFICE_OFFICE_HOME | Directory path to the OpenOffice installation | | JTHUMBNAILER_OPENOFFICE_WORKING_DIR | Working directory path for OpenOffice | | JTHUMBNAILER_OPENOFFICE_TMP_DIR | Directory path for temporary files generated and used by OpenOffice | | THUMBNAIL Properties | | | JTHUMBNAILER_THUMBNAIL_THUMB_WIDTH | Width of generated thumbnails | | JTHUMBNAILER_THUMBNAIL_THUMB_HEIGHT | Height of generated thumbnails | | ASYNC Properties | | | JTHUMBNAILER_ASYNC_CORE_POOL_SIZE | Core pool size for the asynchronous processing tasks | | JTHUMBNAILER_ASYNC_MAX_POOL_SIZE | Maximum pool size for the asynchronous processing tasks | | SERVER Properties | | | JTHUMBNAILER_SERVER_UPLOAD_DIRECTORY | Directory used to store uploads when using API | | JTHUMBNAILER_SERVER_MAX_WAITING_LIST_SIZE | Queue for files to be processed | | SPRING | | | SPRING_SERVLET_MULTIPART_MAX_FILE_SIZE | Maximum allowed file size for multipart file uploads | | SPRING_SERVLET_MULTIPART_MAX_REQUEST_SIZE | Maximum allowed request size for multipart file uploads | | SERVER_PORT | Port on which the Web application will be hosted | | SPRING DOC | | | SPRINGDOC_API_DOCS_PATH | Path for accessing the API documentation in JSON format | | SPRINGDOC_SWAGGER_UI_PATH | Path for accessing the Swagger UI for interactive API documentation |

Requirements

Supported File Formats

Adding Repository

Packages are currently published on Github Registry.Please read this document for more information on using them.

Maven

Step 1. Add the dependency to the pom file:

<dependency>
  <groupId>io.github.makbn</groupId>
  <artifactId>jthumbnail</artifactId>
  <version>2.2.2</version>
</dependency>

Gradle

Step 1. Add the dependency to the build.gradle file:

compile "io.github.makbn:jthumbnail:2.2.2"

TODO

All the tasks and features that are planned to be implemented are moved to the Project board!

Contributing

Contributions are welcome! Please read the contributing guidelines, Code of Conduct, and CLA before opening issues or pull requests.

Original project

JThumbnail is based on an old project of the university of Siegen for the benefit of come_IN Computerclubs. and thanks a lot to @benjaminpick