BestImageViewer / geeqie

claiming to be the best image viewer / photo collection browser
http://www.geeqie.org/
GNU General Public License v2.0
478 stars 79 forks source link

Executing plugin is causing too many exif rereads #680

Closed matrixik closed 5 years ago

matrixik commented 5 years ago

ISSUE TYPE

GEEQIE VERSION

Geeqie 5f04e5cf
     Config results:
    -=-=-=-=-=-=-=-=-

Package:
  Name:          geeqie
  Version:       5f04e5cf

Architecture:
  UNIX:          yes
  Win32:         no (native: no)

Flags:
  Geeqie:        
  DEFS:          -DHAVE_CONFIG_H
  CPPFLAGS:      
  CFLAGS:         -Werror -Wno-error=deprecated-declarations -Wno-error=sign-compare -Wno-error=return-type
  CXXFLAGS:      -g -O2
  Gtk:           -pthread -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include
  Glib:          -pthread -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include
  Thread:        -lgthread-2.0 -pthread -lglib-2.0
  Others:      -llcms2 -lexiv2 -lclutter-1.0 -lcogl-path -latk-1.0 -lcogl-pango -lcogl -lgmodule-2.0 -pthread -lwayland-egl -lgbm -ldrm -lEGL -lXrandr -ljson-glib-1.0 -lgio-2.0 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -lgdk_pixbuf-2.0 -lcairo-gobject -lcairo -lgobject-2.0 -lglib-2.0 -lwayland-cursor -lwayland-client -lxkbcommon -lwayland-server -lX11 -lXext -lXdamage -lXfixes -lXcomposite -lXi -lclutter-gtk-1.0 -lclutter-1.0 -lcogl-path -lcogl-pango -lcogl -lgmodule-2.0 -pthread -lwayland-egl -lgbm -ldrm -lEGL -lXrandr -ljson-glib-1.0 -lwayland-cursor -lwayland-client -lxkbcommon -lwayland-server -lX11 -lXext -lXdamage -lXfixes -lXcomposite -lXi -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lchamplain-0.12 -lclutter-1.0 -lcogl-path -latk-1.0 -lcogl-pango -lcogl -lgmodule-2.0 -pthread -lwayland-egl -lgbm -ldrm -lEGL -lXrandr -ljson-glib-1.0 -lgio-2.0 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -lgdk_pixbuf-2.0 -lcairo-gobject -lcairo -lgobject-2.0 -lglib-2.0 -lwayland-cursor -lwayland-client -lxkbcommon -lwayland-server -lX11 -lXext -lXdamage -lXfixes -lXcomposite -lXi -lchamplain-gtk-0.12 -lclutter-gtk-1.0 -lchamplain-0.12 -lclutter-1.0 -lcogl-path -lcogl-pango -lcogl -lgmodule-2.0 -pthread -lwayland-egl -lgbm -ldrm -lEGL -lXrandr -ljson-glib-1.0 -lwayland-cursor -lwayland-client -lxkbcommon -lwayland-server -lX11 -lXext -lXdamage -lXfixes -lXcomposite -lXi -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -llua5.1

Localization:
  NLS support:   yes
  LINGUAS:        ar be bg ca cs da de el en_GB eo es et eu fi fr hu id it ja ko nb nl pl pt_BR ro ru sk sl sr@latin sr sv th tlh tr uk vi zh_CN zh_TW

Settings:
  Developer:     no
  Debug flags:   no
  Debug log:     yes
  Deprecated:    no

Support:
  LCMS:          yes
  Exiv2:     yes
  Lirc:          no
  Clutter:       yes
  Libchamplain:     yes
  Libchamplain-gtk: yes
  Lua:           yes
  FFmpegthumbnailer:    yes
  Pdf:           no

Documentation:
  Doxygen:       
  doc-tool:      

  Now you can type "make" to build Geeqie
  (or you take blue pill and the story ends :)

SUMMARY

When I execute plugin to do something (in my case copy to different folder one file with sidecar) Geeqie freeze for few seconds and rescan all files in folder.

STEPS TO REPRODUCE

View folder with a lot of files (I have 1436 files, JPG+ARW) on HDD disk. Select one file (with grouping enabled) and click F12 for executing command that copy this group (JPG+ARW files) to some specific folder on SDD disk. Now Geeqie freeze for few seconds, I can click Page Down to go to next images but they won't be showed in big size, I can see as scroll bar in files view instantly growing and then shrinking to accommodate all files again.

Video: https://youtu.be/uoXmFk1X6_4

Desktop file

[Desktop Entry]
Version=1.0
Type=Application

# The name which appears in the menu:
Name=Copy to Pictures
#Name[cs]=
#Name[fr]=
#Name[de]=Vorlage

# Replace "command" with the actual command or script:
#Exec=yes | cp -rf %F ~/Pictures
Exec=geeqie_copy.sh %F &

# %f     A single file name, even if multiple files are selected. The
#        system reading the desktop entry should recognize that the program in
#        question cannot handle multiple file arguments, and it should should
#        probably spawn and execute multiple copies of a program for each
#        selected file if the program is not able to handle additional file
#        arguments. If files are not on the local file system (i.e. are on HTTP
#        or FTP locations), the files will be copied to the local file system
#        and %f will be expanded to point at the temporary file. Used for
#        programs that do not understand the URL syntax.
#
# %F    A list of files. Use for apps that can open several local files
#       at once. Each file is passed as a separate argument to the executable
#       program.
#
# %u    A single URL. Local files may either be passed as file: URLs or
#       as file path.
#
# %U    A list of URLs. Each URL is passed as a separate argument to
#       the executable program. Local files may either be passed as file: URLs
#       or as file path.

# Change the following line to point to an icon of your choosing
Icon=gtk-file

# Use the following to only show this menu entry if the command is installed
#TryExec=command

# Desktop files that are usable only in Geeqie should be marked like this:
Categories=X-Geeqie;
OnlyShowIn=X-Geeqie;

# Uncomment the following line to include in a Geeqie menu,
# other than in the default path of EditMenu/ExternalMenu
#X-Geeqie-Menu-Path=<FileMenuPath>

# e.g.
#X-Geeqie-Menu-Path=SelectMenu/SelectSection

# Valid sections are:
#    FileMenu
#    FileMenu/OpenSection
#    FileMenu/SearchSection
#    FileMenu/PrintSection
#    FileMenu/FileOpsSection
#    FileMenu/QuitSection
#    GoMenu
#    SelectMenu
#    SelectMenu/SelectSection
#    SelectMenu/ClipboardSection
#    SelectMenu/MarksSection
#    EditMenu
#    EditMenu/EditSection
#    EditMenu/OrientationMenu
#    EditMenu/RatingMenu
#    EditMenu/PropertiesSection
#    EditMenu/PreferencesSection
#    PluginsMenu
#    ViewMenu
#    ViewMenu/WindowSection
#    ViewMenu/FileDirMenu
#    ViewMenu/FileDirMenu/FolderSection
#    ViewMenu/FileDirMenu/ListSection
#    ViewMenu/DirSection
#    ViewMenu/ZoomMenu
#    ViewMenu/ZoomMenu/ConnectZoomMenu
#    ViewMenu/SplitMenu
#    ViewMenu/StereoMenu
#    ViewMenu/ColorMenu
#    ViewMenu/OverlayMenu
#    ViewMenu/ViewSection
#    ViewMenu/ToolsSection
#    ViewMenu/SlideShowSection
#    HelpMenu
#    HelpMenu/HelpSection

# This is a filter - see symlink.desktop and geeqie-symlink for an example
# how to use this feature
#X-Geeqie-Filter=true

# It can be made verbose
#X-Geeqie-Verbose=true

X-Geeqie-Hotkey=F12

geeqie_copy.sh

for file in "$@" ; do
  # we get only one file for each group, typically the main one
  # get the sidecars:
  geeqie -r --get-sidecars:"$file" | while read -r sidecar ; do
    # Do something with the each of the grouped files
    yes | cp -rf "$sidecar" ~/Pictures
    #echo "$sidecar"
  done
done

Log file attached (happening in this few seconds) geeqie_freeze.txt

matrixik commented 5 years ago

Looks like this is happening also when I delete file or use "Sort manager". So, for me, viewing images in folders with lot of them is really fast but actually copying/moving/deleting them is really slow.

caclark commented 5 years ago

I am not able to replicate this -- so far. Could you please try setting "Edit/Preferences/General/Refresh on file change" to "disabled"?

matrixik commented 5 years ago

Unfortunately, turning off "Refresh on file change" did not help (I also restarted geeqie just in case).

matrixik commented 5 years ago

OK, looks like it was configuration problem. I moved old configuration folder and started geeqie from scratch and now it's working fast again with all this actions. Sorry for noise.