GijsGoudzwaard / Image-Optimizer

Simple lossless compression for Elementary OS
MIT License
80 stars 9 forks source link

App crashes if directory name contains Chinese characters #24

Closed jonolumb closed 2 weeks ago

jonolumb commented 6 years ago

When I drag photos from a folder whose name contains Chinese characters (for example 测试, Chinese for test), Image Optimizer crashes. If I rename the folder to only contain alphanumeric characters (for example, test), everything works fine. Would appreciate it if this issue could be fixed. Thanks!

rusty-snake commented 5 years ago

Identical with special german characters (äöüÄÖÜ).

VentGrey commented 3 years ago

That's because those chats are unicode and might not work correctly with the actual name parsing of the application

https://wiki.gnome.org/Projects/Vala/StringSample

Hackgets commented 2 years ago

I also drop files with paths containing katakana which causes the app to crash.

ryonakano commented 2 weeks ago

Leaving the backtrace when running gdb:

(com.github.gijsgoudzwaard.image-optimizer:25588): GLib-CRITICAL **: 23:55:03.154: g_strsplit: assertion 'string != NULL' failed

Thread 7 "thread" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffd6a006c0 (LWP 25597)]
0x0000555555566368 in opti_png_getNewSize (self=Python Exception <class 'ValueError'>: Variable 'static_fundamental_type_nodes' not found.
,
    stdout=0x7fffd0001450 "** Processing: /home/ryo/Pictures/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3.png\nError: Can't open the input file\n\n** Status report\n1 file(s) have been processed.\n1 error(s) have been encountered.\n") at ../src/Utils/OptiPng.vala:93
93          return int.parse(text.split(" ")[0]);
(gdb) bt
#0  0x0000555555566368 in opti_png_getNewSize (self=Python Exception <class 'ValueError'>: Variable 'static_fundamental_type_nodes' not found.

   , stdout=0x7fffd0001450 "** Processing: /home/ryo/Pictures/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3.png\nError: Can't open the input file\n\n** Status report\n1 file(s) have been processed.\n1 error(s) have been encountered.\n") at ../src/Utils/OptiPng.vala:93
#1  0x0000555555565dc3 in __lambda7_ (_data2_=0x555555b06160) at ../src/Utils/OptiPng.vala:67
#2  0x0000555555565ff4 in ___lambda7__gthread_func (self=0x555555b06160) at /home/ryo/work/tmp/Image-Optimizer/builddir/OptiPng.c:623
#3  0x00007ffff7e88c82 in ??? () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#4  0x00007ffff709ca94 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:447
#5  0x00007ffff7129c3c in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
(gdb)