dragon66 / icafe

Java library for reading, writing, converting and manipulating images and metadata
Eclipse Public License 1.0
204 stars 58 forks source link

Want to add some new functionalities #54

Closed shubhamvadhera closed 6 years ago

shubhamvadhera commented 6 years ago

Hello

I want to add 2 new features to the TiffTweaker module:

  1. Ability to split the tiff file into byte array to allow in memory operations to the output file ( currently, it only writes the output to disk)
  2. Ability to split the tiff file by number of pages (for ex - splitting a 9 page tiff file into 3 files of 3 pages each, instead of 9 single page files)

I had some questions:

  1. Can I contribute these features ?
  2. Can I use JUnit unit tests ? Currently I do not see any JUnit unit tests.
dragon66 commented 6 years ago

@shubhamvadher

Thanks for your contribution.

The first feature is useful in some cases. Regarding the second feature, what is the use case for that?

Yes, you can use JUnit test.

shubhamvadhera commented 6 years ago

One of the use cases for 2 that we are currently using is - Splitting a large TIFF file (such as 100 pages) to five 20 page files so that they can be:

  1. Sent over network with bandwidth and size restrictions
  2. Sent to a parallel processing environment such as AWS Lambda so that files can be processed in parallel by 5 processes ( for example we need to process the file for image detection, processing a 100 page file serially (one by one) would be too time consuming, and for sending 100 single page files, we need to send 100 requests to the server. Instead, we can send the whole file in 5 bigger chunks of 20 pages each.

Let me know if you have any more questions.

dragon66 commented 6 years ago

@shubhamvadhera Great. Make sense. Go ahead. By the way, use the internal LOOGER object instead of System.out.println for logging and debugging purposes. I also changed a bit of the splitPages method to cope with different endian issue.

shubhamvadhera commented 6 years ago

@dragon66 Thank You. Will keep these things in mind.

dragon66 commented 6 years ago

@shubhamvadhera I have added the function to split a multiple page TIFF into smaller size TIFFs.

dragon66 commented 6 years ago

@shubhamvadhera I have implemented the remaining functions you needed. Please check the latest update. Closing this comment.