QA/Bugzilla/Attachments
TDF LibreOffice Document Liberation Project Community Blogs Weblate Nextcloud Redmine Ask LibreOffice Donate
This page is about Attachments in Bugzilla.
Filesize Limit
- Currently 30MB
Temporarily, we're putting files too large for Bugzilla here on the wiki or on Nextcloud:
MIME Type Problems
- UPDATE: Based on pre- and post-migration testing, we believe that the new TDF Bugzilla does not suffer from the mimetype problems seen on FDO Bugzilla. However, there are browser bugs that still cause problems. Currently we are aware of a mimetype bug in Firefox that was reported in 2007.
We sometimes have problems getting the right MIME type set on Bugzilla attachments. For a period of time, auto-detection for MIME types was disabled in FDO Bugzilla. Tollef re-enabled auto-detection for the LibreOffice product (thank goodness!).
Currently,
- Many attachments have incorrect MIME type
- Many binary documents are marked as text/plain
Nuances
Michael Stahl points out that there are some special cases to consider when cleaning up MIME types:
- MIME type may not match file extension
- "this is a docx file with .doc extension and LO can't load it" (this was an actual example)
- Possible Solution: Ignore file extension and just compare Bugzilla MIME type with embedded MIME type in file.
- File format does not have a specified MIME type
- e.g. MSO 2003 XML files
- (For now, we're using type "text/xml")
- Microsoft Office XML formats - (Internet media type: ?)
- they can't figure it out, either
- Stack Overflow comments - (suggests
text/xml
)
- e.g. MSO 2003 XML files
Automation
It makes sense for us to have some type of automation (or at least automatic notification) to help us clean up improperly-annotated attachments.
External References
Current Manual Fixing
What we do now:
- Look up attachments of a particular MIME type - "set a 'Custom Search' on 'Attachment mime type' 'is equal to' <mime type you would like to kill>"
- e.g. Here is the search for
application/octet-stream
- e.g. Here is the search for
- Look at file extension and confirm that it matches the MIME type in Bugzilla
- If the extension does not match the MIME type, update the MIME type (Note: See MStahl's cautionary note about believing file extensions, above)
Shortlist of extensions and MIME types
File | Extension | MIME type |
---|---|---|
Image Formats | ||
JPEG Image | jpg, jpeg | image/jpeg |
PNG Image | png | image/png |
SVG Image | svg | image/svg+xml |
OpenDocument Formats | ||
OpenDocument Text | ODT | application/vnd.oasis.opendocument.text |
OpenDocument Graphics | ODG | application/vnd.oasis.opendocument.graphics |
OpenDocument Presentation | ODP | application/vnd.oasis.opendocument.presentation |
OpenDocument Spreadsheet | ODS | application/vnd.oasis.opendocument.spreadsheet |
OpenDocument Formula | ODF
(yes, really!) |
application/vnd.oasis.opendocument.formula |
OpenDocument Database | ODB | application/vnd.oasis.opendocument.database |
Flat ODF stuff | many | Unclear...perhaps text/xml ? |
MS OOXML Formats | ||
OOXML Spreadsheet | XLSX | application/vnd.openxmlformats-officedocument.spreadsheetml.sheet |
OOXML Spreadsheet + Macros | XLSM | application/vnd.ms-excel.sheet.macroEnabled.12 |
OOXML Spreadsheet Binary + Macros | XLSB | application/vnd.ms-excel.sheet.binary.macroEnabled.12 |
OOXML Spreadsheet Template | XLTX | application/vnd.openxmlformats-officedocument.spreadsheetml.template |
OOXML Presentation | PPTX | application/vnd.openxmlformats-officedocument.presentationml.presentation |
OOXML Slideshow | PPSX | application/vnd.openxmlformats-officedocument.presentationml.slideshow |
OOXML Presentation Template | POTX | application/vnd.openxmlformats-officedocument.presentationml.template |
OOXML Wordprocessing | DOCX | application/vnd.openxmlformats-officedocument.wordprocessingml.document |
OOXML Wordprocessing Template | DOTX | application/vnd.openxmlformats-officedocument.wordprocessingml.template |
MS Binary Formats | ||
MS PowerPoint (binary) | PPT | application/vnd.ms-powerpoint |
MS PowerPoint Show (binary) | PPS | application/vnd.ms-powerpoint |
MS PowerPoint Template (binary) | POT | application/vnd.ms-powerpoint |
MS Word (binary) | DOC | application/msword |
MS Word Template (binary) | DOT | application/msword |
MS Excel (binary) | XLS | application/vnd.ms-excel |
MS Excel Template (binary) | XLT | application/vnd.ms-excel |
Everything Else | ||
RTF | rtf | application/rtf |
application/pdf | ||
MS Visio (XML) | vsdx | application/vnd.ms-visio.drawing |
MS Visio (binary) | vsd | application/vnd.visio |
MS Publisher | pub | application/x-mspublisher |
Apple Pages (iWork) | pages | application/vnd.apple.pages |
Apple Numbers (iWork) | numbers | application/vnd.apple.numbers |
Apple Keynote (iWork) | key | application/vnd.apple.keynote |
Apple Works / Claris Works | cwk | application/clarisworks |
Mac Writer | mw | application/macwriteii |
Hangul | hwp | application/x-hwp |
pdb | application/x-aportisdoc | |
pdb_plucker | application/prs.plucker | |
pdb_palm | application/vnd.palm | |
lrf | application/x-sony-bbeb | |
psw | application/x-pocket-word | |
602 | application/x-t602 | |
fb2 | application/x-fictionbook+xml | |
fh | image/x-freehand | |
cmx | image/x-cmx | |
wpg | image/x-wpg |
Scripting
The general idea
- Create user 'MIMEtype Fixer'
- Use XML-RPC/etc.. API
- Get list of all attachments (id, filename, MIMEtype)
- Foreach attachment, compare (embedded) file MIMEtype w/Bugzilla MIMEtype
- If they don't match, fix (or possibly review before fix)