mirror of
https://github.com/freedomofpress/dangerzone.git
synced 2025-04-28 18:02:38 +02:00
Add hwp hwpx support
hwp/hwpx has several custom MIME types .hwp: - application/x-hwp - application/haansofthwp - application/vnd.hancom.hwp .hwpx: - application/haansofthwpx - application/vnd.hancom.hwpx, - application/hwp+zip Fixes #243
This commit is contained in:
parent
d8cc24cebe
commit
3e895adbab
5 changed files with 38 additions and 2 deletions
|
@ -14,7 +14,8 @@ RUN apk --no-cache -U upgrade && \
|
||||||
poppler-data \
|
poppler-data \
|
||||||
python3 \
|
python3 \
|
||||||
py3-magic \
|
py3-magic \
|
||||||
tesseract-ocr
|
tesseract-ocr \
|
||||||
|
font-noto-cjk
|
||||||
|
|
||||||
# Download the trained models from the latest GitHub release of Tesseract, and
|
# Download the trained models from the latest GitHub release of Tesseract, and
|
||||||
# store them under /usr/share/tessdata. This is basically what distro packages
|
# store them under /usr/share/tessdata. This is basically what distro packages
|
||||||
|
|
|
@ -36,6 +36,7 @@ Dangerzone can convert these types of document into safe PDFs:
|
||||||
- ODF Spreadsheet (`.ods`)
|
- ODF Spreadsheet (`.ods`)
|
||||||
- ODF Presentation (`.odp`)
|
- ODF Presentation (`.odp`)
|
||||||
- ODF Graphics (`.odg`)
|
- ODF Graphics (`.odg`)
|
||||||
|
- Hancom HWP (Hangul Word Processor) (`.hwp`, `.hwpx`)
|
||||||
- Jpeg (`.jpg`, `.jpeg`)
|
- Jpeg (`.jpg`, `.jpeg`)
|
||||||
- GIF (`.gif`)
|
- GIF (`.gif`)
|
||||||
- PNG (`.png`)
|
- PNG (`.png`)
|
||||||
|
|
|
@ -77,6 +77,26 @@ class DocumentToPixels(DangerzoneConverter):
|
||||||
"application/vnd.oasis.opendocument.text-template": {
|
"application/vnd.oasis.opendocument.text-template": {
|
||||||
"type": "libreoffice",
|
"type": "libreoffice",
|
||||||
},
|
},
|
||||||
|
# .hwp
|
||||||
|
"application/vnd.hancom.hwp": {
|
||||||
|
"type": "libreoffice",
|
||||||
|
},
|
||||||
|
"application/haansofthwp": {
|
||||||
|
"type": "libreoffice",
|
||||||
|
},
|
||||||
|
"application/x-hwp": {
|
||||||
|
"type": "libreoffice",
|
||||||
|
},
|
||||||
|
# .hwpx
|
||||||
|
"application/vnd.hancom.hwpx": {
|
||||||
|
"type": "libreoffice",
|
||||||
|
},
|
||||||
|
"application/haansofthwpx": {
|
||||||
|
"type": "libreoffice",
|
||||||
|
},
|
||||||
|
"application/hwp+zip": {
|
||||||
|
"type": "libreoffice",
|
||||||
|
},
|
||||||
# At least .odt, .docx, .odg, .odp, .ods, and .pptx
|
# At least .odt, .docx, .odg, .odp, .ods, and .pptx
|
||||||
"application/zip": {
|
"application/zip": {
|
||||||
"type": "libreoffice",
|
"type": "libreoffice",
|
||||||
|
|
|
@ -553,7 +553,7 @@ class DocSelectionWidget(QtWidgets.QWidget):
|
||||||
self.file_dialog.setFileMode(QtWidgets.QFileDialog.ExistingFiles)
|
self.file_dialog.setFileMode(QtWidgets.QFileDialog.ExistingFiles)
|
||||||
self.file_dialog.setNameFilters(
|
self.file_dialog.setNameFilters(
|
||||||
[
|
[
|
||||||
"Documents (*.pdf *.docx *.doc *.docm *.xlsx *.xls *.pptx *.ppt *.odt *.odg *.odp *.ods *.jpg *.jpeg *.gif *.png *.tif *.tiff)"
|
"Documents (*.pdf *.docx *.doc *.docm *.xlsx *.xls *.pptx *.ppt *.odt *.odg *.odp *.ods *.hwp *.hwpx *.jpg *.jpeg *.gif *.png *.tif *.tiff)"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -143,6 +143,20 @@ if p == "Darwin":
|
||||||
"CFBundleTypeName": "ODF Graphics Document",
|
"CFBundleTypeName": "ODF Graphics Document",
|
||||||
"CFBundleTypeRole": "Viewer",
|
"CFBundleTypeRole": "Viewer",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"CFBundleTypeExtensions": ["hwp", "hwpx"],
|
||||||
|
"CFBundleTypeIconFile": "../macos/document.icns",
|
||||||
|
"CFBundleTypeMIMETypes": [
|
||||||
|
"application/vnd.hancom.hwp",
|
||||||
|
"application/haansofthwp",
|
||||||
|
"application/x-hwp",
|
||||||
|
"application/vnd.hancom.hwpx",
|
||||||
|
"application/haansofthwpx",
|
||||||
|
"application/hwp+zip",
|
||||||
|
],
|
||||||
|
"CFBundleTypeName": "Hancom Office Document",
|
||||||
|
"CFBundleTypeRole": "Viewer",
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"CFBundleTypeExtensions": ["jpg", "jpeg"],
|
"CFBundleTypeExtensions": ["jpg", "jpeg"],
|
||||||
"CFBundleTypeIconFile": "../macos/document.icns",
|
"CFBundleTypeIconFile": "../macos/document.icns",
|
||||||
|
|
Loading…
Reference in a new issue