Graphics importer uses case-sensitive filenames

Bug #1832853 reported by Povi
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
KiCad
Fix Committed
Low
Seth Hillbrand

Bug Description

Hello,

I using nightly build and in PCBnew File -> Import -> Graphics. I cannot see any dxf files. I have tried with multiple different versions of dxf. On Kicad v5 I can see and import all dxf files.

Application: Pcbnew
Version: 6.0.0-unknown-daad58e~100~ubuntu16.04.1, release build
Libraries:
    wxWidgets 3.0.2
    libcurl/7.47.0 OpenSSL/1.0.2g zlib/1.2.8 libidn/1.32 librtmp/2.3
Platform: Linux 4.15.0-29-generic x86_64, 64 bit, Little endian, wxGTK
Build Info:
    wxWidgets: 3.0.2 (wchar_t,wx containers,compatible with 2.8) GTK+ 2.24
    Boost: 1.58.0
    OpenCASCADE Community Edition: 6.8.0
    Curl: 7.47.0
    Compiler: GCC 5.4.0 with C++ ABI 1009

Tags: dxf pcbnew
Revision history for this message
Nick Østergaard (nickoe) wrote :

Shat is the filename of the dxf you want to import?

Revision history for this message
Povi (povi2946) wrote :

Okay, so I figured it out. It just the extension name was in capital letters. I received file from a colleague that used .DXF I renamed it to .dxf and nightly version was able to find it.

Seth Hillbrand (sethh)
Changed in kicad:
assignee: nobody → Seth Hillbrand (sethh)
importance: Undecided → Low
milestone: none → 6.0.0-rc1
status: New → Triaged
summary: - cannot view/find dxf files
+ Graphics importer uses case-sensitive filenames
Revision history for this message
KiCad Janitor (kicad-janitor) wrote :

Fixed in revision 36f70704ebb9fb28a32cb277a6ae9755403875c2
https://git.launchpad.net/kicad/patch/?id=36f70704ebb9fb28a32cb277a6ae9755403875c2

Changed in kicad:
status: Triaged → Fix Committed
Revision history for this message
Wayne Stambaugh (stambaughw) wrote :

@Seth, there is a potential albeit unlikely bug in your fix. Any combination of upper and lower case letters are valid extensions. The robust solution is to use "[Dd][Xx][Ff]" regex which covers all possible combinations correct in gtk builds. This is handled in common/wildcards_and_files_ext.cpp.

Revision history for this message
Seth Hillbrand (sethh) wrote :

Thanks for the pointer Wayne! I'll update with the robust solution.

Changed in kicad:
status: Fix Committed → In Progress
Revision history for this message
KiCad Janitor (kicad-janitor) wrote :

Fixed in revision 79e2000af41abd536937be3ad1eea3685a97420d
https://git.launchpad.net/kicad/patch/?id=79e2000af41abd536937be3ad1eea3685a97420d

Changed in kicad:
status: In Progress → Fix Committed
tags: added: pcbnew
Revision history for this message
Ian McInerney (imcinerney) wrote :

@Seth, did you cherry-pick this fix back to the 5.1 branch, or is it too involved to change there? The duplicate to this was filed against the 5.1 branch.

Revision history for this message
Seth Hillbrand (sethh) wrote :

@Ian- I just checked the 5.1 code and it properly uses the *.[dD][xX][fF] string, so it should work. I don't have a windows machine to test this on, however. It does work as expected for linux.

Revision history for this message
Aleksandr Sh (dsa-t) wrote :

Still happens in

Application: Pcbnew
Version: (5.1.4-54-g82a0eb441)-1, release build
Libraries:
    wxWidgets 3.0.4
    libcurl/7.61.1 OpenSSL/1.1.1 (WinSSL) zlib/1.2.11 brotli/1.0.6 libidn2/2.0.5 libpsl/0.21.0 (+libidn2/2.1.1) nghttp2/1.34.0
Platform: Windows 8 (build 9200), 64-bit edition, 64 bit, Little endian, wxMSW
Build Info:
    wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8)
    Boost: 1.68.0
    OpenCASCADE Community Edition: 6.9.1
    Curl: 7.61.1
    Compiler: GCC 8.2.0 with C++ ABI 1013

Build settings:
    USE_WX_GRAPHICS_CONTEXT=OFF
    USE_WX_OVERLAY=OFF
    KICAD_SCRIPTING=ON
    KICAD_SCRIPTING_MODULES=ON
    KICAD_SCRIPTING_PYTHON3=OFF
    KICAD_SCRIPTING_WXPYTHON=ON
    KICAD_SCRIPTING_WXPYTHON_PHOENIX=OFF
    KICAD_SCRIPTING_ACTION_MENU=ON
    BUILD_GITHUB_PLUGIN=ON
    KICAD_USE_OCE=ON
    KICAD_USE_OCC=OFF
    KICAD_SPICE=ON

Revision history for this message
Seth Hillbrand (sethh) wrote :

Maybe this report is differ. @Aleksandr- Can you select the dxf file but not import it? Or can you not see it at all?

Revision history for this message
Aleksandr Sh (dsa-t) wrote :

Yes, I can select .DXF and .dxf files using Browse button. After selecting, the file field will contain the proper filename.
But when I press OK, "There is no plugin to handle this file type" message comes up

Revision history for this message
Aleksandr Sh (dsa-t) wrote :

Yes, looks like a different issue.

Revision history for this message
Ian McInerney (imcinerney) wrote :

@Seth, the fix you added is only active on GTK. The function that adds in the upper/lowercase characters to the regex has #ifdef __WXGTK__ surrounding its contents.

@Wayne, is there a reason you made the function FormatWildcardExt only give the regex form on GTK?

Revision history for this message
Wayne Stambaugh (stambaughw) wrote :

@Ian, the GTK file dialog is case sensitive so foo.dxf and foo.DXF do not have the same file extension. The GTK file dialog also supports regular expressions to solve the extension case issue. AFAIK, neither MSW or macOS support regular expressions for file extension filtering so that is why the #ifdef __WXGTK__ exists.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.