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

Add an attached document (PDF) #1889

Open
3 tasks
docjyJ opened this issue May 19, 2024 · 8 comments
Open
3 tasks

Add an attached document (PDF) #1889

docjyJ opened this issue May 19, 2024 · 8 comments
Labels
common: occasional Affects or can be seen by some users regularly or most users rarely severity: minor Impairs non-critical functionality or suitable workarounds exist type: enhancement New feature or request

Comments

@docjyJ
Copy link

docjyJ commented May 19, 2024

It would be practical to be able to add the original document.

Currently, it is possible to reach photos of the original card.

But, some virtual gift card are in PDF format, and it is not possible to join them.
It is useful because perfecting the original document must be presented, there is supplementary info or confidential code.

Some Issue is about it but they are closing :

#1196 (comment)
It may be better to just use a third-party app to convert one PDF page into an image?

It's true but it's not the best solution

#496 (comment)
maybe we can just use an "attach" option, for any kind of document, wich opens a new app.

I think it's the better way to implement this functionality

Summary:

  • Possibility of adding an attachment.
  • Open the document with the application of the system.
  • Added the document automatically when a new card adds from a PDF.

Thank you, your app is great!

@TheLastProject
Copy link
Member

I think I've seen this request come up before. Back then there was no PDF scan support, but given there is now it might be reasonable to extend it.

I basically see two different features here, which may or may not be connected and I'm wondering what the correct UI flow for them would be. Getting these things right is quite challenging 😅

Feature 1: Adding non-image attachments

Right now, the edit screen has 3 tabs: Card, Options and Photos. Given how attachments are a bit more power-usery, "Card" is probably not the right place to put them. "Options" also doesn't feel very sensible (those are currently more advanced "card options" like grouping, notes, etc.). So, the most logical place would be either "Photos" or a new tab, but adding a 4th tab might make the screen very busy.

Right now the "Photos" tab has a "Front image" and "Back image". Obviously, random attachments like PDFs are not images.

Image of the Photos tab in the edit view

I see several options here:

  1. Rename it to "Front side" and "Back side": This has the clear downside that we're losing the logical connection to a real-life loyalty card, as in real-life you can't have a document on the front side.
  2. Rename the tab to "Attachments" and add a list of one or more attachments below that, so you can have both images and attachments: This has the downside that people may not look under "Attachments" to manage the front and back image (may cause confusion) and makes it impossible to sort attachments before photos.
  3. Something else altogether?

For displaying, we again have several options:

  1. Display the PDF inline with an image of the first page: Either a bit more storage-heavy (as we'll have to create a PNG copy of the first page) or slow while switching (as we'll have to render the first page of the PDF in real time). Rendering the first page and storing a PNG copy during saving is probably the only realistic option here.
  2. Display the PDF inline with a generic "PDF file" image with the file name below it: Less user-friendly.
  3. Display the PDF somewhere on the info screen.
Displaying a PDF inline Displaying in the info screen
Inline PDF example Info screen example

For opening, we can reuse the existing image logic to open a system PDF reader instead.

Feature 2: Automatically add source image/file on scan

This could either be saved and displayed as a generic attachment, using the "Feature 1" logic (although we probably do want new fields then) or perhaps we want to more explicitly state this is the import source below the barcode or in the info screen? That way we prevent showing users what may very well be the exact same image twice when they press next (both the generated barcode and the scanned original)

A mock-up of the view screen with the text "Imported from PDF" below the barcode, indicating the barcode was generated from a PDF file

@TheLastProject TheLastProject added type: enhancement New feature or request state: consensus-needed A consensus needs to be reached before this can be implemented labels May 20, 2024
@docjyJ
Copy link
Author

docjyJ commented May 20, 2024

I think the best way is simplicity.

You do an excellent job on this application! Thank you so much!

Rename the tab to "Attachments" and add a list of one or more attachments below that, so you can have both images and attachments

I think this is the simplest way.

may cause confusio

It is possible to add a placeholder.

Display the PDF inline with a generic "PDF file" image with the file name below it

The option to generate an image can be done later

we want to more explicitly state this is the import source

By adding a title to each file, it is possible to put a title by default “original imported”.

image image
placeholder displaying

These are just examples, made as you want.

I think it's the simplest and intuitive way.

Do something as generic as possible to simplify the code and give the most liberty to the user.

I hope my English is not too bad. Thank ❤️

@TheLastProject
Copy link
Member

I see we both lean towards updating the "photos" tab. I do worry about things being confusing to users when they can't set a PDF for the first two images but can for the others so maybe we should just change "Front image" and "Back image" to "Attachment 1" and "Attachment 2" and allow more attachments.

Your suggestion of putting the image type below the image when you're not viewing the barcode is very good, I implemented that in #1894. (I already know people are going to ask to reorder their attachments next, but well, that can be later).

@TheLastProject TheLastProject added severity: minor Impairs non-critical functionality or suitable workarounds exist common: occasional Affects or can be seen by some users regularly or most users rarely and removed state: consensus-needed A consensus needs to be reached before this can be implemented labels May 20, 2024
@docjyJ
Copy link
Author

docjyJ commented May 20, 2024

I do worry about things being confusing to users when they can't set a PDF for the first two images but can for the others so maybe we should just change "Front image" and "Back image" to "Attachment 1" and "Attachment 2" and allow more attachments.

Yes, it needs to be done in a more logical way. Maybe adding hints can help show the usefulness of the feature:

image

@BrilliantTrees
Copy link

This looks like a fantastic idea I've been playing with both Catima and Google Wallet to test the storage of loyalty cards and MUCH prefer your interface with the ability to store images of a given card (which I think makes the selection process easier if you have multiple cards stored) and minimising any data I share with Google is always a good thing!

Storing PDF's for vouchers or tickets would be a great enhancement

At present Google doesn't seem to have an option to store PDF's directly unless the ticket provider sends the confirmation email with the "Save to Wallet" option. We have a couple of upcoming theatre tickets and only have PDF's (with no "Save to Wallet" option) and although I can open the PDF, screenshot it and then import to Catima as a new image its much more of faff than importing a PDF directly.

Given that the thread above seems to suggest that you agree with the development request have you a timeline for possible implementation assuming you have gaps in your schedule?

Forgive my ignorance but I stumbled on this particular thread after trying one of the features on the current app and it not behaving as I expected. When adding a new entry under the "More Options" pop up there is the option to "Select a PDF File" but when I select a PDF from the phones files folder it returns an error message of "No Barcode Found" despite the PDF file in question being a barcode ticket. Am I completely misunderstanding what the "Select a PDF" option is intended to do or doing something wrong?

Thanks in advance

@TheLastProject
Copy link
Member

Sorry but I don't give timelines. Catima is an unpaid hobby project, things will come when I feel like working on them. For stressing about deadlines I already have my dayjob ;) If other people submit merge requests that can sometimes speed things up if the code is easy enough to review that reviewing is faster than writing it myself :)

Your PDF file not working is most likely related to #1215 as the PDF import converts every page to an image and then uses the same code as the extracting-barcode-from-image code. It indeed should work as you're describing, but there are some edge cases where the image-to-barcode conversion fails (and I'm still not sure why).

@docjyJ
Copy link
Author

docjyJ commented May 26, 2024

MUCH prefer your interface with the ability to store images of a given card and minimising any data I share with Google is always a good thing!

I truly agree!

Thank you very much @TheLastProject (and all the contributors) for your magnificent work !!

Catima is for me the best alternative foss and maintained. ❤️

@BrilliantTrees
Copy link

Sorry but I don't give timelines. Catima is an unpaid hobby project, things will come when I feel like working on them. For stressing about deadlines I already have my dayjob ;) If other people submit merge requests that can sometimes speed things up if the code is easy enough to review that reviewing is faster than writing it myself :)

No problem on timeline I understand that real life commitments come first, it was just a cheeky enquiry as would have been great to set up our theatre tickets today. I'll just have to go old school and either keep confirmation email or keep the PDF tickets in my download folder on phone

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
common: occasional Affects or can be seen by some users regularly or most users rarely severity: minor Impairs non-critical functionality or suitable workarounds exist type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants