pdf-visual-diff icon indicating copy to clipboard operation
pdf-visual-diff copied to clipboard

Minor enhancement suggestion: Allow users to write text on masks

Open Songyu-Wang opened this issue 2 years ago • 2 comments

I think it would be fairly easy to update the code at

https://github.com/moshensky/pdf-visual-diff/blob/master/src/compare-pdf-to-snapshot.ts#L37C8-L39C10

to something like this

 if (type === 'rectangle-mask') {
         let  mask = new Jimp(width, height, colorToNum[color])
          mask.print(...)  // process mask with https://github.com/jimp-dev/jimp/tree/main/packages/plugin-print
          img.composite(mask, x, y)
        }

With this update, a user can easily communicate what each mask region is for. the screenshots could be easier to understand in the follow use cases:

  1. if the creator and the maintainer are not the same person
  2. The code was written a long time ago
  3. code review

Songyu-Wang avatar Sep 20 '23 04:09 Songyu-Wang

You are right, it indeed looks somewhat easy to be added. Would you like to contribute?

moshensky avatar Sep 21 '23 14:09 moshensky

Unfortunately, not at the moment because I found this repo via work related reasons and we have a open source contribution approval process with legal that I'm not really excited to go through (yes, even for MIT).

I'm happy to contribute if my employer decides to adopt this tool so I have a business case to make. Or a few years later when the policy changes

Songyu-Wang avatar Sep 21 '23 14:09 Songyu-Wang

I don’t have immediate plans to implement this functionality at the moment, so I’ll be closing the issue for now. If anyone would like to see this feature added in the future, feel free to comment or reopen the issue.

moshensky avatar Sep 11 '24 14:09 moshensky