Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 0 additions & 58 deletions .github/workflows/fuzz.yml

This file was deleted.

36 changes: 2 additions & 34 deletions docs/ENGINES.md
Original file line number Diff line number Diff line change
Expand Up @@ -342,13 +342,7 @@ nested `<svg>`, CSS and text are resolved the same way.
## HWPX writer

Filee writes OWPML (HWPX) itself, so saving as HWPX needs no Hancom Office and shows no approval dialog.
Readers turn the source into a small document model (`Hwp/Hwpx/HwpxModel.cs`) and `HwpxWriter` writes the package.
The model also keeps what a renderer needs and the writers ignore (`Hwp/Hwpx/HwpxModel.Layout.cs`): line rules with
the source's meaning (Word's multiple and document grid, 한글's "between lines"), 한글's seven language slots and Word's
four run fonts, paragraph borders and line breaking, stored line layouts, crops, rotation, z-order, master pages,
polygons, curves and arcs (`HwpxReader.ReadForLayout` also keeps runs apart by that detail and reads master pages and
those shapes, which `Read` leaves out as before). `StyleResolver` turns what a document leaves to the
한글 style into concrete values. What the readers take over:
Readers turn the source into a small document model (`Hwp/Hwpx/HwpxModel.cs`) and `HwpxWriter` writes the package:

- **DOCX** is read directly (`Hwp/Hwpx/Docx/DocxReader*.cs`) so the layout survives:
- page size, orientation and margins per section; columns, also when they change mid-page;
Expand Down Expand Up @@ -628,8 +622,7 @@ sits on the office donut (settings schema 27 teaches existing donuts `.ofd`).
resource files (PublicRes, DocumentRes, a page's PageRes, and the unnamed `Res.xml` WPS writes next to them).
Parts are looked up by name inside the ZIP and never written out under their own names; references are resolved
against the referring part (or the package root for "/…"), "." and ".." applied, and anything that leaves the
package, a URL or a drive path finds nothing. The package is read like HWPX and DOCX (`Documents/DocumentPackage.cs`,
see [HWPX reader](#hwpx-reader)): XML without DTDs; a part may unpack to 64 MB, a picture to
package, a URL or a drive path finds nothing. XML is read without DTDs; a part may unpack to 64 MB, a picture to
32 MB (larger ones are left out), the whole package to 1 GB; at most 100,000 parts, 10,000 pages, 2,000,000
drawing objects, page blocks nested 32 deep. DeltaX / DeltaY "g n d" repeats never yield more values than the
text has characters.
Expand Down Expand Up @@ -1235,31 +1228,6 @@ OLE objects, charts, video, form controls, text art (its text is kept), arcs / p
master pages, memos, character ratio, relative size and offset, paragraph borders, picture cropping and rotation.
Password-protected (encrypted) HWPX and DRM-wrapped files stop with a clear error.

**Limits.** Untrusted documents must not hang, exhaust the memory or crash Filee. The HWPX, DOCX and OFD readers (and
the HWP 5.0 reader and the layout engine when they come) share `Documents/DocumentLimits.cs`; a document that passes
one stops with `error.document_too_complex` and says which:

- the package (`Documents/DocumentPackage.cs`): at most 100,000 parts; a part may unpack to 64 MB, all parts together
to 1 GB, counted while they unpack (a ZIP header can understate a size), and a part over 4 MB to no more than 200
times its packed size; parts are found by name inside the package only, and extracted pictures get names Filee
makes (`hwpx-media-1.png`), never the part's;
- XML (`Infrastructure/SafeXml.cs`, also used for KML and GPX): no DTD and no resolver, so no entity expands and
nothing outside the package is read; at most 512 levels deep and 5,000,000 elements in a package;
- the document (`Documents/DocumentBudget.cs`): tables in tables, text boxes, notes, groups and fields nest at most 32
levels; at most 1,000,000 paragraphs and 200,000 tables, pictures and drawing objects; table columns, spans and
row spans are cut to the table (at most 16,384 columns); Word style chains are followed 20 styles deep;
- pictures (`Documents/PictureSize.cs`): one whose PNG, JPEG, GIF, BMP or WebP header claims more than
16,384 × 16,384 pixels is left out before anything decodes it;
- layout (`Documents/LayoutGuard.cs`, for the layout engine): at most 20,000 pages, 64 empty pages in a row, ten minutes;
cancellation and the time are checked per paragraph, and an object larger than the page is clipped and placed.

Embedded fonts (DOCX `word/fonts`, HWPX and OFD font files) are not read; a reader that uses them must pass them
through Filee's SFNT parser (`Fonts/SfntFont.cs`) first. `DocumentHostileInputTests` holds ZIP bombs, deep nesting,
DTDs and huge pictures; `DocumentFuzzTests` changes packages written in code at random (attributes set to extreme
values, elements removed, repeated, renamed or nested, text and bytes damaged) and allows a reader only to read a
file or refuse it with `InvalidDataException` / `ConversionRefusedException`. It runs briefly with every test run and
for a few minutes per reader every night (`.github/workflows/fuzz.yml`); `FILEE_FUZZ_SEED` repeats a run.

## E-books

The built-in e-book engine (`src/Filee.Engines/Ebooks`) reads books into the same document model as the HWPX
Expand Down
1 change: 0 additions & 1 deletion src/Filee.App/Assets/i18n/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@
"error.fon_unsupported": "هذا النوع من خطوط ‎.fon غير مدعوم",
"error.fon_too_large": "خط ‎.fon كبير جدًا بحيث لا يمكن تحويله",
"error.fon_damaged": "ملف ‎.fon تالف أو غير مكتمل",
"error.document_too_complex": "المستند كبير جدًا أو معقّد جدًا بحيث لا يمكن قراءته بأمان",
"error.m4s_needs_init": "ملف ‎.m4s هذا جزء من فيديو متدفّق، ولا يمكن قراءته دون مقطع البداية (init) المنفصل الخاص به",
"notice.pdf_not_smaller": "تعذّر تقليل الحجم، لذا نُسخ الملف كما هو",
"notice.cad_newer_left_out": "حُذفت كائنات لا يدعمها إصدار AutoCAD المختار (أسهم توضيحية متعددة، شبكات …)",
Expand Down
1 change: 0 additions & 1 deletion src/Filee.App/Assets/i18n/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@
"error.fon_unsupported": "Diese Art von .fon-Schrift wird nicht unterstützt",
"error.fon_too_large": "Die .fon-Schrift ist zu groß zum Konvertieren",
"error.fon_damaged": "Die .fon-Datei ist beschädigt oder unvollständig",
"error.document_too_complex": "Das Dokument ist zu groß oder zu komplex, um es sicher zu lesen",
"error.m4s_needs_init": "Diese .m4s-Datei ist ein Stück eines gestreamten Videos und lässt sich ohne ihr separates Startsegment (init) nicht lesen",
"notice.pdf_not_smaller": "Die Datei ließ sich nicht verkleinern und wurde unverändert kopiert",
"notice.cad_newer_left_out": "Objekte, die die gewählte AutoCAD-Version nicht unterstützt (Multiführungslinien, Netze …), wurden weggelassen",
Expand Down
1 change: 0 additions & 1 deletion src/Filee.App/Assets/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@
"error.fon_unsupported": "This kind of .fon font isn't supported",
"error.fon_too_large": "The .fon font is too large to convert",
"error.fon_damaged": "The .fon file is damaged or cut short",
"error.document_too_complex": "The document is too large or too complex to read safely",
"error.m4s_needs_init": "This .m4s is one piece of a streamed video: it can't be read without its separate start (init) segment",
"notice.pdf_not_smaller": "Couldn't make it smaller, so it was copied as it is",
"notice.cad_newer_left_out": "Objects the chosen AutoCAD version doesn't have (multileaders, meshes …) were left out",
Expand Down
1 change: 0 additions & 1 deletion src/Filee.App/Assets/i18n/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@
"error.fon_unsupported": "Este tipo de fuente .fon no es compatible",
"error.fon_too_large": "La fuente .fon es demasiado grande para convertirla",
"error.fon_damaged": "El archivo .fon está dañado o incompleto",
"error.document_too_complex": "El documento es demasiado grande o complejo para leerlo de forma segura",
"error.m4s_needs_init": "Este .m4s es un fragmento de un vídeo en streaming y no se puede leer sin su segmento de inicio (init) aparte",
"notice.pdf_not_smaller": "No se pudo reducir su tamaño, por lo que se copió tal cual",
"notice.cad_newer_left_out": "Se omitieron objetos que la versión de AutoCAD elegida no tiene (directrices múltiples, mallas…)",
Expand Down
1 change: 0 additions & 1 deletion src/Filee.App/Assets/i18n/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@
"error.fon_unsupported": "Ce type de police .fon n'est pas pris en charge",
"error.fon_too_large": "La police .fon est trop grande pour être convertie",
"error.fon_damaged": "Le fichier .fon est endommagé ou incomplet",
"error.document_too_complex": "Le document est trop volumineux ou trop complexe pour être lu en toute sécurité",
"error.m4s_needs_init": "Ce .m4s est un morceau d'une vidéo diffusée en streaming : il ne peut pas être lu sans son segment de départ (init) séparé",
"notice.pdf_not_smaller": "Impossible de réduire sa taille : le fichier a été copié tel quel",
"notice.cad_newer_left_out": "Des objets que la version d'AutoCAD choisie n'a pas (multilignes de repère, maillages…) ont été omis",
Expand Down
1 change: 0 additions & 1 deletion src/Filee.App/Assets/i18n/hi.json
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@
"error.fon_unsupported": "इस तरह का .fon फ़ॉन्ट समर्थित नहीं है",
"error.fon_too_large": ".fon फ़ॉन्ट बदलने के लिए बहुत बड़ा है",
"error.fon_damaged": ".fon फ़ाइल खराब है या अधूरी है",
"error.document_too_complex": "दस्तावेज़ इतना बड़ा या जटिल है कि उसे सुरक्षित रूप से पढ़ा नहीं जा सकता",
"error.m4s_needs_init": "यह .m4s स्ट्रीम किए गए वीडियो का एक हिस्सा है: इसके अलग शुरुआती (init) सेगमेंट के बिना इसे पढ़ा नहीं जा सकता",
"notice.pdf_not_smaller": "इसे छोटा नहीं किया जा सका, इसलिए जैसा है वैसा ही कॉपी कर दिया गया",
"notice.cad_newer_left_out": "चुने गए AutoCAD संस्करण में न होने वाले ऑब्जेक्ट (मल्टीलीडर, मेश …) छोड़ दिए गए",
Expand Down
1 change: 0 additions & 1 deletion src/Filee.App/Assets/i18n/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@
"error.fon_unsupported": "この種類の.fonフォントには対応していません",
"error.fon_too_large": ".fonフォントが大きすぎて変換できません",
"error.fon_damaged": ".fonファイルが破損しているか、途中で切れています",
"error.document_too_complex": "文書が大きすぎるか複雑すぎるため、安全に読み込めません",
"error.m4s_needs_init": "この .m4s はストリーミング動画の一部で、別にある開始(init)セグメントがないと読み込めません",
"notice.pdf_not_smaller": "サイズを小さくできなかったため、元のままコピーしました",
"notice.cad_newer_left_out": "選んだ AutoCAD のバージョンにないオブジェクト(マルチ引出線、メッシュ …)を省きました",
Expand Down
1 change: 0 additions & 1 deletion src/Filee.App/Assets/i18n/ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@
"error.fon_unsupported": "지원하지 않는 종류의 .fon 글꼴이에요",
"error.fon_too_large": ".fon 글꼴이 너무 커서 변환할 수 없어요",
"error.fon_damaged": ".fon 파일이 손상되었거나 잘렸어요",
"error.document_too_complex": "문서가 너무 크거나 복잡해서 안전하게 읽을 수 없어요",
"error.m4s_needs_init": "스트리밍 동영상의 한 조각인 .m4s 파일이에요. 따로 있는 시작(init) 세그먼트 없이는 읽을 수 없어요",
"notice.pdf_not_smaller": "더 작게 만들 수 없어서 그대로 복사했어요",
"notice.cad_newer_left_out": "선택한 AutoCAD 버전에 없는 개체(다중 지시선, 메시 …)는 빼고 저장했어요",
Expand Down
1 change: 0 additions & 1 deletion src/Filee.App/Assets/i18n/ne.json
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@
"error.fon_unsupported": "यस प्रकारको .fon फन्ट समर्थित छैन",
"error.fon_too_large": ".fon फन्ट रूपान्तरण गर्न धेरै ठूलो छ",
"error.fon_damaged": ".fon फाइल बिग्रिएको वा अपूर्ण छ",
"error.document_too_complex": "कागजात सुरक्षित रूपमा पढ्न नसकिने गरी धेरै ठूलो वा जटिल छ",
"error.m4s_needs_init": "यो .m4s स्ट्रिम गरिएको भिडियोको एउटा टुक्रा हो: छुट्टै सुरुवाती (init) खण्डबिना यसलाई पढ्न सकिँदैन",
"notice.pdf_not_smaller": "यसलाई सानो बनाउन सकिएन, त्यसैले जस्तो छ त्यस्तै प्रतिलिपि गरियो",
"notice.cad_newer_left_out": "छानिएको AutoCAD संस्करणमा नभएका वस्तुहरू (मल्टिलिडर, मेस …) छोडिए",
Expand Down
1 change: 0 additions & 1 deletion src/Filee.App/Assets/i18n/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@
"error.fon_unsupported": "Ten rodzaj czcionki .fon nie jest obsługiwany",
"error.fon_too_large": "Czcionka .fon jest zbyt duża, aby ją przekonwertować",
"error.fon_damaged": "Plik .fon jest uszkodzony lub niekompletny",
"error.document_too_complex": "Dokument jest zbyt duży lub zbyt złożony, aby bezpiecznie go odczytać",
"error.m4s_needs_init": "Ten plik .m4s to fragment wideo strumieniowego i nie da się go odczytać bez osobnego segmentu początkowego (init)",
"notice.pdf_not_smaller": "Nie udało się zmniejszyć pliku, więc skopiowano go bez zmian",
"notice.cad_newer_left_out": "Pominięto obiekty, których wybrana wersja AutoCAD nie ma (multiodnośniki, siatki…)",
Expand Down
1 change: 0 additions & 1 deletion src/Filee.App/Assets/i18n/pt-BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@
"error.fon_unsupported": "Este tipo de fonte .fon não é compatível",
"error.fon_too_large": "A fonte .fon é grande demais para converter",
"error.fon_damaged": "O arquivo .fon está danificado ou incompleto",
"error.document_too_complex": "O documento é grande ou complexo demais para ser lido com segurança",
"error.m4s_needs_init": "Este .m4s é um pedaço de um vídeo transmitido por streaming e não pode ser lido sem o seu segmento inicial (init) separado",
"notice.pdf_not_smaller": "Não deu para deixar menor, então foi copiado como está",
"notice.cad_newer_left_out": "Objetos que a versão do AutoCAD escolhida não tem (multilinhas de chamada, malhas…) ficaram de fora",
Expand Down
1 change: 0 additions & 1 deletion src/Filee.App/Assets/i18n/pt-PT.json
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@
"error.fon_unsupported": "Este tipo de fonte .fon não é suportado",
"error.fon_too_large": "A fonte .fon é demasiado grande para converter",
"error.fon_damaged": "O ficheiro .fon está danificado ou incompleto",
"error.document_too_complex": "O documento é demasiado grande ou complexo para ser lido em segurança",
"error.m4s_needs_init": "Este .m4s é um pedaço de um vídeo em streaming e não pode ser lido sem o respetivo segmento inicial (init) separado",
"notice.pdf_not_smaller": "Não foi possível reduzir o tamanho, pelo que o ficheiro foi copiado sem alterações",
"notice.cad_newer_left_out": "Os objetos que a versão de AutoCAD escolhida não suporta (linhas de chamada múltiplas, malhas…) foram omitidos",
Expand Down
1 change: 0 additions & 1 deletion src/Filee.App/Assets/i18n/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@
"error.fon_unsupported": "Этот тип шрифта .fon не поддерживается",
"error.fon_too_large": "Шрифт .fon слишком велик для преобразования",
"error.fon_damaged": "Файл .fon повреждён или обрезан",
"error.document_too_complex": "Документ слишком большой или сложный, чтобы безопасно его прочитать",
"error.m4s_needs_init": "Этот .m4s — фрагмент потокового видео: без отдельного начального сегмента (init) его не прочитать",
"notice.pdf_not_smaller": "Уменьшить не получилось, файл скопирован как есть",
"notice.cad_newer_left_out": "Объекты, которых нет в выбранной версии AutoCAD (мультивыноски, сети…), не сохранены",
Expand Down
1 change: 0 additions & 1 deletion src/Filee.App/Assets/i18n/th.json
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@
"error.fon_unsupported": "ไม่รองรับฟอนต์ .fon ประเภทนี้",
"error.fon_too_large": "ฟอนต์ .fon มีขนาดใหญ่เกินกว่าจะแปลงได้",
"error.fon_damaged": "ไฟล์ .fon เสียหายหรือไม่สมบูรณ์",
"error.document_too_complex": "เอกสารใหญ่หรือซับซ้อนเกินกว่าจะอ่านได้อย่างปลอดภัย",
"error.m4s_needs_init": "ไฟล์ .m4s นี้เป็นชิ้นส่วนหนึ่งของวิดีโอสตรีมมิง และอ่านไม่ได้หากไม่มีเซกเมนต์เริ่มต้น (init) ที่แยกไว้",
"notice.pdf_not_smaller": "ไม่สามารถบีบอัดให้เล็กลงได้ จึงคัดลอกไฟล์ตามเดิม",
"notice.cad_newer_left_out": "ละวัตถุที่ AutoCAD เวอร์ชันที่เลือกไม่มี (มัลติลีดเดอร์ เมช …) ไว้",
Expand Down
1 change: 0 additions & 1 deletion src/Filee.App/Assets/i18n/tr.json
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@
"error.fon_unsupported": "Bu tür .fon yazı tipi desteklenmiyor",
"error.fon_too_large": ".fon yazı tipi dönüştürmek için çok büyük",
"error.fon_damaged": ".fon dosyası hasarlı veya eksik",
"error.document_too_complex": "Belge güvenli şekilde okunamayacak kadar büyük veya karmaşık",
"error.m4s_needs_init": "Bu .m4s, akışla gelen bir videonun bir parçası: ayrı başlangıç (init) segmenti olmadan okunamaz",
"notice.pdf_not_smaller": "Küçültülemediği için olduğu gibi kopyalandı",
"notice.cad_newer_left_out": "Seçilen AutoCAD sürümünün desteklemediği nesneler (çoklu kılavuzlar, ağlar…) çıkarıldı",
Expand Down
Loading
Loading