MTGProxyPrinter

View Ticket
Login

View Ticket

Ticket Hash: 418371f8a10e36494fb1a3eda33cf5d536c8d08c
Title: Add custom images to pages
Status: Closed Type: Feature_Request
Severity: Important Priority: Low
Subsystem: Affects_Multiple Resolution: Fixed
Last Modified: 2024-04-11 08:44:57
Version Found In:
User Comments:
thomas added on 2021-03-06 10:36:04:

Implement adding custom, user-supplied images to the document.

Use-cases:

  • Printing scans of altered cards
  • Printing custom cards or tokens

Implementation note

  • Allow adding images via drag&drop onto the main window. On a drop event, determine if the drop is an image. If not, ignore it. If yes, add a custom Card instance to the page, as if the user clicked the “Add” button. Ask the user how many copies they want to insert when dropping the image.
  • It should be possible to re-use the Card class to hold the data.
    • Use the file name, if available, as the card name for display purposes
    • Use the image_file attribute to store the Pixmap in memory
    • Set all other, unrelated text fields to empty strings or None
  • The Document class needs to save the custom images to disk when the user saves a document with custom images
    • Modify the database schema to hold custom images and all relevant data
    • Store the image data as a BLOB in the Document when saving.
    • Add a new relation “CustomImages” that holds them as de-duplicated data as columns image_id, name, image_blob
    • Modify Document.Card, adding a new column custom_image_id referencing CustomImages
    • Modify the constraints to be either scryfall_id NOT NULL or custom_image_id NOT NULL.

thomas added on 2023-04-27 13:55:58:

 

Custom card manager

Added cards should be added to the database as custom sets. To manage these printings, the application needs a custom card manager.

It should consist of two tables, a custom sets table and a set member table.

Custom sets table

Relevant columns are set name and set code. It should be able to select sets and remove them. Also cells should be editable, to update set names and codes. When a set is selected, the members should be shown in the set member table.

Set member table

Relevant columns are card name, collector number and image file. The image file column should show the file name and a preview on mouse-over, just like the one the card image manager provides.

It should be able to update a card image via drag and drop. Also adding new images should work via drag&drop. When dropping an image between rows, it should add the image as a new card, deriving the card name from the file name and the collector number from the position it was dropped on.

Dropping multiple cards should process each of them.

Re-ordering via drag&drop should be possible, automatically adjusting the collector number


thomas added on 2023-04-28 14:11:55:

.

Compatibility with duplex printing

Assign back faces to custom sets

Custom sets need back faces for duplex printing, if that gets implemented.

Each custom set needs a back face, so the custom set editor needs to set one. The user should be able to set an existing one, from among the official back faces and previously registered custom ones, or supply a custom image.

Back images do not have a name associated with them, so generate one for the official back faces. Best way is probably based on the first sets name it was used with. Let the user assign a custom name for custom back faces.

Deletion

Also add an ability to delete custom back faces.


thomas added on 2023-05-17 21:47:27:

If custom cards are implemented as custom sets, these have to be saved in the document save format

Idea for loading

When such a document is loaded, the custom set/cards have to be imported into the database from the document

The database should use transaction savepoints to be able to rollback the database to the previous state, if the user undoes the document loading. When a savepoint is active, enable a new action to permanently commit the import.

If that is triggered, lingering savepoints in the undo stack have to be removed.


thomas added on 2024-04-11 08:44:57:

The base premise of this ticket is implemented. Closing.