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

Support printing images directly based on mimetypes cups supports #2174

Merged
merged 2 commits into from
Aug 23, 2024

Conversation

rocodes
Copy link
Contributor

@rocodes rocodes commented Aug 23, 2024

Status

Ready for review.

Description

Fixes issue with printing images introduced in #2166. Libreoffice supports embedding images and printing them from within LibreOffice, but because many image types aren't in their .desktop file(s) supported MimeTypes, they aren't candidates for pdf conversion. Based on the list of supported types in /usr/share/cups/mime, add direct printing support for many image mimetypes.

Also renames ERROR_MIMETYPE_UNKNOWN to ERROR_MIMETYPE_UNSUPPORTED, which is more accurate, and raise ERROR_MIMETYPE_DISCOVERY (instead of UNKNOWN/UNSUPPORTED) if an error is encountered with parsing mimetypes.

Test Plan

  • Visual Review
  • CI

Checklist

If these changes modify code paths involving cryptography, the opening of files in VMs or network (via the RPC service) traffic, Qubes testing in the staging environment is required. For fine tuning of the graphical user interface, testing in any environment in Qubes is required. Please check as applicable:

  • I have tested these changes in the appropriate Qubes environment
  • I do not have an appropriate Qubes OS workstation set up (the reviewer will need to test these changes)
  • These changes should not need testing in Qubes

If these changes add or remove files other than client code, the AppArmor profile may need to be updated. Please check as applicable:

  • I have updated the AppArmor profile
  • No update to the AppArmor profile is required for these changes
  • I don't know and would appreciate guidance

If these changes modify the database schema, you should include a database migration. Please check as applicable:

  • I have written a migration and upgraded a test database based on main and confirmed that the migration is self-contained and applies cleanly
  • I have written a migration but have not upgraded a test database based on main and would like the reviewer to do so
  • I need help writing a database migration
  • No database schema changes are needed

@rocodes rocodes requested a review from a team as a code owner August 23, 2024 17:52
@rocodes rocodes added this to the 0.13.0 milestone Aug 23, 2024
@rocodes rocodes force-pushed the support-direct-print-images branch from 10f52f6 to 9f28a72 Compare August 23, 2024 17:54
@legoktm legoktm changed the title Support printing images directly based on mimetypes cups supports [0.13.0] Support printing images directly based on mimetypes cups supports Aug 23, 2024
@legoktm legoktm changed the title [0.13.0] Support printing images directly based on mimetypes cups supports Support printing images directly based on mimetypes cups supports Aug 23, 2024
@rocodes rocodes mentioned this pull request Aug 23, 2024
13 tasks
Copy link
Member

@legoktm legoktm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two comments, I think they're minor in that leaving unknown mime types is harmless but they piqued my curiosity.

export/securedrop_export/print/service.py Outdated Show resolved Hide resolved
export/securedrop_export/print/service.py Outdated Show resolved Hide resolved
@rocodes
Copy link
Contributor Author

rocodes commented Aug 23, 2024

Good catches - I will remove them

@rocodes rocodes force-pushed the support-direct-print-images branch from 9f28a72 to 7008d33 Compare August 23, 2024 18:14
…a more accurate term; an unknown mimetype will raise ERROR_MIMETYPE_DISCOVERY.
@rocodes rocodes force-pushed the support-direct-print-images branch from 7008d33 to 50b40cd Compare August 23, 2024 18:18
@legoktm legoktm merged commit eb5a345 into main Aug 23, 2024
58 checks passed
@legoktm legoktm deleted the support-direct-print-images branch August 23, 2024 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants