Page 1 of 1

Play animated gifs when viewing thumbnails

Posted: 10 Oct 2021 08:26
by davidhelp
Is it possible to play animated gifs when viewing thumbnails when not holding down the mouse cursor on the image?

Re: Play animated gifs when viewing thumbnails

Posted: 10 Oct 2021 10:14
by admin
The thumbs should be animated right in the list? No, not possible.

Re: Play animated gifs when viewing thumbnails

Posted: 10 Oct 2021 20:18
by klownboy
Hi davidhelp, you should take a look at TheQwerty's very nice HTMLImagePreview here viewtopic.php?f=7&t=13690. You can specify what type of files to view (e.g., gifs) with a load command:
Global $G_FILTERS_OVERRIDE = '*.gif'; Load 'HTMLImagePreview', 'select', 'f';

The XYplorer script is also available here https://github.com/XYplorer-Scripts/HTMLImagePreview.
Set a User defined command of the category, "Run Script" and assign a keyboard shortcut to it.

Re: Play animated gifs when viewing thumbnails

Posted: 11 Oct 2021 00:27
by davidhelp
Thanks for the script.

XYplorer folder that has the gifs is open. Next I go to: Scripting> Load Script File
I browse to where the HTMLImagePreview.xys file is located.
A seperate window opens. The animated gifs all play.
I can also drag the gifs in the order I want.

It does not remember the order the next time I open.
I have to do the steps above to run the script each time.
I did not see a way to customize the toolbar to Load script file or have it load the HTMLImagePreview.xys file automatically.


"Set a User defined command of the category, "Run Script" and assign a keyboard shortcut to it"
I added Global $G_FILTERS_OVERRIDE = '*.gif'; Load 'HTMLImagePreview', 'select', 'f';
It plays when I go to 'Run Script'

Questions: How to assign a keyboard shortcut to do this?
Plus the window that plays the gifs cannot be minimized but can only be closed.
It would be handy if one could switch to other folders that had gifs.

Re: Play animated gifs when viewing thumbnails

Posted: 11 Oct 2021 00:41
by highend
Set a User defined command of the category, "Run Script"
You did read that?

That's the place where you can assign the keyboard shortcut^^

Re: Play animated gifs when viewing thumbnails

Posted: 11 Oct 2021 00:55
by davidhelp
How to and assign a keyboard shortcut to it? A toolbar button?

To assign a toolbar button:

Right click on toolbar> Customize toolbar
Scroll down to: User Button #2
Use the Add -> button to move to the right pane.
Left click on it and a dialog box comes up. Give the button a Name
On left click: click on Edit button. A dialog box appears and you add the script in

Global $G_FILTERS_OVERRIDE = '*.gif'; Load 'HTMLImagePreview', 'select', 'f';

Click the OK button then click the OK button again.
Now you can go to a folder with the animated gifs are located then click on the new toolbar button and see the seperate window open that will show all the gifs playing.

Re: Play animated gifs when viewing thumbnails

Posted: 11 Oct 2021 01:01
by highend

Re: Play animated gifs when viewing thumbnails

Posted: 11 Oct 2021 01:07
by davidhelp
Thanks.

Question: The window that plays the gifs cannot be minimized but can only be closed.
It would be handy if one could switch to other folders that had gifs.
Can this be done?

Re: Play animated gifs when viewing thumbnails

Posted: 11 Oct 2021 12:38
by klownboy
The script itself doesn't support what you are asking. You could set up a Custom Event Action in Configuration under the category "Changing Location" that would check the the newly entered folder for GIF files and if present run the script. It may be a bit cumbersome.

Re: Play animated gifs when viewing thumbnails

Posted: 12 Oct 2021 04:48
by davidhelp
Thanks, a bit beyond what I could do : )

Re: Play animated gifs when viewing thumbnails

Posted: 12 Oct 2021 19:43
by klownboy
Hi davidhelp, I put together a small script which you can use to automatically run TheQwerty's HTMLImagePreview here viewtopic.php?f=7&t=13690 when ever you enter designated folders which contain gif files. I won't repeat instructions here since they're contained in the comment notes at the beginning of the script. Let me know if you have a problem getting it to work.

Code: Select all

//***This script (gifrunner.xys) runs TheQwerty's HTMLImagePreview script https://www.xyplorer.com/xyfc/viewtopic.php?f=7&t=13690 when you enter a folder containing gif files.
//***Save this file as gifrunner.xys in your xyscripts folder
//***The script will only run when entering a designated folder (and subs) you specifiy in variable $gif_folder (e.g., "G:\Gifs")
//***This was done to eliminate running the script unnecessarily upon entering "every" folder even if the folder has a few gif files
//***In Configuration > Custom Event Actions for "Event" block "Changing Locations", "After painting the file list, change
//***the "Action" block to Run script and in the "Script" block enter, load "<xyscripts>\gifrunner.xys";
//***Hit Esc to close the HTML gif viewer before moving on to another folder of gifs

   $gif_folder = "G:\Gifs";  //specify here the main folder where your gifs are located, will incorporate subs folders
   if(exists(<curitem>) == 2) {$cur_folder = <curitem>;} else {$cur_folder = <curpath>;}
   $gifpaths = $gif_folder . <crlf> . listfolder($gif_folder, , 2, <crlf>);
   if(gettokenindex($cur_folder, $gifpaths, <crlf>, "c") > "0") {
      tweak("SkipBrowseEvents","0");
      $gif_files = quicksearch("*.gif /n");
      if (gettoken($gif_files, "count", <crlf>) < 1) {
         status "Folder contains no GIF files.","FF0000","ready";
         end 1;
      }
      else {
         Global $G_FILTERS_OVERRIDE = '*.gif';
         Load 'HTMLImagePreview', 'select', 'f';
      }
   }
   else {
      end 1;
   }