Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expand the character types that the exif function can accept #61141

Open
motohirooya opened this issue Mar 22, 2025 · 6 comments
Open

Expand the character types that the exif function can accept #61141

motohirooya opened this issue Mar 22, 2025 · 6 comments
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Expressions Related to the QGIS expression engine or specific expression functions Windows Related to Windows operating system

Comments

@motohirooya
Copy link

motohirooya commented Mar 22, 2025

Feature description

Currently, the exif function in the field calculator only works with paths separated by / and single-byte characters.
I would like it to work with paths separated by \ or with multi-byte characters.

exif('C:/Users/Public/exif/photo/IMG_0072.JPG')
->OK
exif('C:\Users\Public\exif\photo\IMG_0072.JPG')
->NG

exif('C:/Users/Public/exif/写真/IMG_0072.JPG')
->NG

-----------Change to bug---------------

What is the bug or the crash?*

exif and exif_geotag function doesn't accept non-ascii characters

Steps to reproduce the issue*

Create a directory with non-ascii characters and put your photo files in it.
Create a new vector layer, open the field calculator and enter the formula below.

exif('C:/Users/Public/exif/写真/IMG_0072.JPG')
Here, 'C:/Users/Public/exif/Photos/IMG_0072.JPG' is the path to the photo above.
An empty 'map' data structures is returned.

geom_to_wkt( exif_geotag('C:/Users/Public/exif/写真/IMG_0072.JPG') )
'Point EMPTY' is returned.

Versions*

QGIS version
3.42.0-Münster
QGIS code revision
feb8023

Libraries
Qt version
5.15.13
Python version
3.12.9
GDAL version
3.10.2
PROJ version
9.5.1 (Compiled)
9.6.0 (Running)
EPSG Registry database version
v12.004 (2025-03-02)
GEOS version
3.13.0-CAPI-1.19.0 (Compiled)
3.13.1-CAPI-1.19.2 (Running)
SQLite version
3.46.1
PDAL version
2.8.3
PostgreSQL client version
17.3
SpatiaLite version
5.1.0
QWT version
6.3.0
QScintilla2 version
2.14.1
OS version
Windows 10 Version 2009

Active Python plugins
db_manager
0.1.20
grassprovider
2.12.99
MetaSearch
0.3.6
processing
2.12.99

Supported QGIS version

Each month, there is a new release of QGIS. According to the release schedule, you should at least be running a supported QGIS version. You can check the release schedule https://www.qgis.org/en/site/getinvolved/development/roadmap.html#release-schedule
I'm running a supported QGIS version according to the roadmap.
->YES

New profile

Did you try with a new QGIS profile? Some issues or crashes might be related to plugins or user configuration. You must try with a new profile to check if the issue remains. Read this link how to create a new profile https://docs.qgis.org/latest/en/docs/user_manual/introduction/qgis_configuration.html#working-with-user-profiles
I tried with a new QGIS profile
->YES

@Alex-Kent
Copy link
Contributor

separated by ''

Note on Github comment formatting:
Backslash is an escape character. To include it as a character you need to escape it by preceding it with another backslash:
'\\' (typed in comment) → '\' (displayed).

@motohirooya
Copy link
Author

separated by ''

Note on Github comment formatting: Backslash is an escape character. To include it as a character you need to escape it by preceding it with another backslash: '\\' (typed in comment) → '' (displayed).

Yes, that's right. It was only a problem with multibyte characters.

@agiudiceandrea
Copy link
Member

agiudiceandrea commented Mar 22, 2025

@motohirooya, it seems to me the fact that using non ASCII characters in the file path leads to no results it is a bug. This is probably a Windows only issue.

@agiudiceandrea agiudiceandrea added Expressions Related to the QGIS expression engine or specific expression functions Bug Either a bug report, or a bug fix. Let's hope for the latter! and removed Feature Request labels Mar 22, 2025
@motohirooya
Copy link
Author

@agiudiceandrea I changed it to the content of the bug.
I also added the exif_geotag function because it returns an empty geometry if non-ascii characters are in the path.

@Alex-Kent
Copy link
Contributor

Just a hunch: Modern Unix systems use UTF-8 character encoding whilst Windows uses UTF-16 (though they're trying to move to UTF-8). Mayhaps on Windows there's a missing encoding conversion before passing these paths to the OS?

@agiudiceandrea agiudiceandrea added the Windows Related to Windows operating system label Mar 23, 2025
@motohirooya motohirooya reopened this Mar 23, 2025
@motohirooya
Copy link
Author

I closed it by mistake.
I don't know what the technical problem is, but I recall having a similar issue in the past.
#56023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Expressions Related to the QGIS expression engine or specific expression functions Windows Related to Windows operating system
Projects
None yet
Development

No branches or pull requests

3 participants