You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tika.apache.org by "Kyubin Park (Jira)" <ji...@apache.org> on 2026/10/14 07:12:00 UTC

[jira] [Commented] (TIKA-4394) DXF files with a comment in the first two lines are sometimes detected as text/plain

    [ https://issues.apache.org/jira/browse/TIKA-4394?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18126952#comment-18126952 ] 

Kyubin Park commented on TIKA-4394:
-----------------------------------

Hi, my name is Kyubin Park. I'm part of a five-student group at the Australian National University considering contributing to this issue, subject to tutor approval. Is anyone currently working on it, and would a focused fix with regression tests be welcome? Any guidance on the intended scope would be appreciated.

> DXF files with a comment in the first two lines are sometimes detected as text/plain
> ------------------------------------------------------------------------------------
>
>                 Key: TIKA-4394
>                 URL: https://issues.apache.org/jira/browse/TIKA-4394
>             Project: Tika
>          Issue Type: Bug
>    Affects Versions: 2.9.3, 3.1.0
>            Reporter: Sandro Lackner
>            Priority: Major
>         Attachments: testDXF_long_top_comment-1.dxf, testDXF_no_comment.dxf, testDXF_original_comment.dxf, testDXF_short_top_comment.dxf, testDXF_shorter_top_comment.dxf
>
>
> When working with DXF files i realized that Tika fails to detect the correct MIME type for some of them. Instead of "image/vnd.dxf;format=ascii" Tika detects them as "text/plain".
> After some analysis I found out that longer comments in the beginning of the DXF files lead to this behaviour. Attached you'll find my test files from which only the "shorter" and "no_comment" ones are detected correctly.
> The "original" DXF file contains the comment which lead to this finding in the first place. We got it from a customer who uses the GEONIS framework for DXF file creation, which is a ESRI ArcGIS-Desktop extension. It seems to use the netDXF framework for creation, which writes this comment in the first line.
> {noformat}
> Dxf file generated by netDxf https://netdxf.codeplex.com, Copyright(C) 2009-2016 Daniel Carvajal, Licensed under LGPL
> {noformat}
> Looking through the Tika GitHub I realized that the tika-mimetypes.xml contains a regular expression in the magic match for the mime type "image/vnd.dxf;format=ascii" that limits the length of a comment at the beginning of the file to 64 characters.
> This regex was added for TIKA-3550 with the following [commit|https://github.com/apache/tika/commit/e9f36cb7425f25a768eb58936505277ccbecfedf].
> In my opinion the limit of 64 characters should be removed and replaced by a more fitting regular expression for ascii dxf file detection.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)