GIMP Chat http://gimpchat.com/ |
|
Shortening mouse/keystrokes save/export script or method to implement? http://gimpchat.com/viewtopic.php?f=8&t=20332 |
Page 1 of 3 |
Author: | kittmaster [ Sun Mar 19, 2023 7:14 am ] |
Post subject: | Shortening mouse/keystrokes save/export script or method to implement? |
GIMP Version: 2.10.34 Operating System: Windows GIMP Experience: Intermediate Level List any relevant plug-ins or scripts: Many, but doesn't affect my inquiry List any ERROR messages you received: None I am looking for a solution that can help me simplify creating media after i save an .xcf file. I'm am doing "clearart" for my Media center files that use Kodi. It is a multi step process but the most tedious is exporting. Is there a script or method that will allow for: - When I save as file.xcf - Invoke > File > Export As > file-clearart.png (Simultaneously....in the same folder file.xcf > automatic overwrite without warning) I am 100% aware about accidental overwrites, but since the export is the caboose of the process...I don't care....and I have backups of all the old if it were a problem....and it is a function of....if I save it as the file.xcf then I want the .png of that save regardless. Is there a way to make this behavior occur? I don't personally write scripts and I don't have the bandwidth to learn it now, eventually I will. I have over 250 items to get through and it is going to take time. So I'm trying to minimize any keystrokes/mouse movements. I've allocated a lot of keyboard shortcuts for the creation method...but I can't seem to find a way to simultaneously save and export. Is there a script already out there or a way to do this? Thank you, Chris |
Author: | AlSchemist [ Thu Apr 06, 2023 3:54 pm ] |
Post subject: | Save .xcf and export .png |
Save .xcf and export .png With this shorter title, you would have an answer earlier since "Shortening mouse/keystrokes" does NOT affect your basic inquiry. save_and_export.scm by Rob should solve the issue. ![]() There are two functions that will appear in the first menu "File":
Code: Select all C:\Users\YourWindowsUserName\AppData\Roaming\GIMP\2.10\scripts Replace "YourWindowsUserName" with your real UserName in Windows to find the real path. Then restarts Gimp. The new menus "Save XCF and export..." and "Save-As XCF and export..." are grayed by default until you open a picture from your 250 items used by Kodi. One will never know what is the file extension of these items. ![]() The first function save-as-and-export should be used the first time to save as .xcf and export as .png. The dialog box asks you the folder and the filename. Check the option [x] Export a png and eventually uncheck the option [ ] Export a jpg. The second function save-and-export is simpler since there are only the two checkboxes png or/and jpg. This means that the picture has already been saved, that is to say the picture has a name. The Rob's script saves .xcf and .png with the same basename in the same folder. ![]() |
Author: | kittmaster [ Fri Apr 07, 2023 6:55 am ] |
Post subject: | Re: Shortening mouse/keystrokes save/export script or method to implem |
Downloaded and used, does a good job, may tweak it for my application, but certainly saves some time. I'm already down to about 20 or so left, but will be helpful for future events. The file extensions are nothing more than .jpg and .png. All my movies are mp4 and the skin uses the images for a great presentation of the movie showing actors and the rest. Not really sure why items is italicized, they are just background removed images with a transparent background etc. Thanks for the assist. |
Author: | kittmaster [ Fri Apr 07, 2023 6:57 am ] |
Post subject: | Re: Shortening mouse/keystrokes save/export script or method to implem |
As an FYI, here is the source information of what the applications are be used for: https://kodi.wiki/view/Artwork_types Breaks down all of it, so I'd have an .xcf of the layered artwork, and then the file export based on requirement of the art type needed be it, keyart, disc art.. etc. ![]() |
Author: | AlSchemist [ Fri Apr 07, 2023 11:25 am ] |
Post subject: | Learning basic string operations on the path |
Great news, Chris! ![]() The following is a basic introduction to Script-Fu. You may wish to read it to tweak the Rob's script for your application but not immediately. Learning basic string operations on the path Close Gimp. Reopen Gimp then open a picture. The file extension does not matter. In this example, "File" > "Open" iconAlSchemist.png Open the Script-Fu console by the following menu: "Filters" > "Script-Fu" > "Console" In the rectangular input box above the "Help" button and at the left of the "Browse" button, copy and paste: Code: Select all (gimp-version) Press ENTER to validate the call of the function. Gimp will reply: ("2.10.34") The answer is displayed as a list containing only one element: the version number as a string. Let us display the list of loaded images: Code: Select all (gimp-image-list) (1 #(1)) There is one picture in the editor. Its id is 1 if you have previously closed Gimp then reopened Gimp Otherwise the id could be incremented. To remember the id of the image, let us define the variable img used as parameter in the Rob's functions. Code: Select all (define img 1) Script-Fu replies with the name of the define, that is to say img. What is the value of img? Code: Select all img 1 What is the full path of the current image? save-and-export uses the Gimp API gimp-image-get-filename: Code: Select all (gimp-image-get-filename img) ("C:\\Tool\\Gimp\\forum\\GimpChat\\iconAlSchemist.png") We are in Windows because of the double backslash. Gimp always returns a list. To get the first element of the list that is to say the string of the path, call the car function. Code: Select all (car (gimp-image-get-filename img)) "C:\\Tool\\Gimp\\forum\\GimpChat\\iconAlSchemist.png" Let us save this fullname: Code: Select all (define fullname (car (gimp-image-get-filename img))) fullname If you get the error #<EOF>, verify the number of closing parenthesis. Code: Select all fullname "C:\\Tool\\Gimp\\forum\\GimpChat\\iconAlSchemist.png" ![]() Copy in the clipboard by Ctrl+C the name of the function gimp-image-get-filename Click the Browse button in the Script-Fu console. Then paste the name of the function in the dialog box Script-Fu Procedure Browser. Gimp will display the help of this function. Note that there is only one parameter called image. We defined this parameter with the shorter name "img" as in Rob's script. |
Author: | AlSchemist [ Fri Apr 07, 2023 11:40 am ] |
Post subject: | Working with the path |
Working with the path We want to retrieve the filename of the fullname. So cut the path in a list of tokens removing each backslash. Code: Select all (strbreakup fullname DIR-SEPARATOR) ("C:" "Tool" "Gimp" "forum" "GimpChat" "iconAlSchemist.png") The filename is the last item of this list. Code: Select all (define filename (car (last (strbreakup fullname DIR-SEPARATOR)))) filename Code: Select all filename "iconAlSchemist.png" We want to extract the basename before the dot: Code: Select all (define basename (car (strbreakup filename "."))) basename Code: Select all basename "iconAlSchemist" We want to add for example the suffix "-clearart.png" Code: Select all (define filePng (string-append basename "-clearart.png")) filePng Code: Select all filePng "iconAlSchemist-clearart.png" Instead of using (define varName value), let* us introduce local variables: Code: Select all (let* ( (fullname (car (gimp-image-get-filename img))) "iconAlSchemist-clearart.png" However, we want to save .png in the same folder than .xcf: It is recommended to edit the Scheme code in the free NotePad++. NotePad++ is able to color the parenthesis by level. if you specify the language by NotePad++ menu "Language" > "Scheme". Code: Select all (let* ( (fullname (car (gimp-image-get-filename img))) "C:\\Tool\\Gimp\\forum\\GimpChat\\iconAlSchemist-clearart.png" The function reverse is able to reverse the order of items in a list. Code: Select all (reverse (list "C:" "Tool" "Gimp" "forum" "GimpChat" "iconAlSchemist.png")) ("iconAlSchemist.png" "GimpChat" "forum" "Gimp" "Tool" "C:") cdr returns the list without its first item. Code: Select all (cdr (reverse (list "C:" "Tool" "Gimp" "forum" "GimpChat" "iconAlSchemist.png"))) ("GimpChat" "forum" "Gimp" "Tool" "C:") This begins to become complex with this double reverse. Code: Select all (reverse (cdr (reverse (list "C:" "Tool" "Gimp" "forum" "GimpChat" "iconAlSchemist.png")))) ("C:" "Tool" "Gimp" "forum" "GimpChat") That is why there is drop-right in 1srfi-001-list.scm from the GimpLambdaLib: Code: Select all (drop-right (list "C:" "Tool" "Gimp" "forum" "GimpChat" "iconAlSchemist.png") 1) ("C:" "Tool" "Gimp" "forum" "GimpChat") |
Author: | AlSchemist [ Sat Apr 08, 2023 7:28 am ] |
Post subject: | Vector of Kodi art types |
Vector of Kodi art types Introducing a vector of art types: It is like a list but prefixed by sharp "#". Vector is faster than list and item in a vector can be directly extracted by vector-ref. By convention, the first letter in the name of a vector is the letter "v". Code: Select all (define vKodiArtSuffix #("actor" "back" "banner" "characterart" "clearart" "clearlogo" "discart" "fanart" "fanartSharp" "keyart" "landscape" "poster" "spine" "thumb")) vKodiArtSuffix We can retrieve a particular art type as a 0-based index in an array: Code: Select all (vector-ref vKodiArtSuffix 4) "clearart" Remember the list of picture ids returned by gimp-image-list. Code: Select all (gimp-image-list) (1 #(1)) It is a list having the number of pictures open in Gimp followed by a vector of picture ids. Let us loop to display all art types. To simplify, we group both the definition of the function DisplayAllArtType followed by its call. The function displayln displays a text then returns to the line. This function is defined in C:\Program Files\GIMP 2\share\gimp\2.0\scripts\palette-export.scm Code: Select all (define (DisplayAllArtType) DisplayAllArtType art type 0: actor art type 1: back art type 2: banner art type 3: characterart art type 4: clearart art type 5: clearlogo art type 6: discart art type 7: fanart art type 8: fanartSharp art type 9: keyart art type 10: landscape art type 11: poster art type 12: spine art type 13: thumb () We can synthetize previous posts by the following function having img as parameter. This function returns a vector composed by the path, the basename and the file extension of the image id "img": Code: Select all (define (PathInfoPic img) PathInfoPic#("C:\\Tool\\Gimp\\forum\\GimpChat" "iconAlSchemist" "png") Reminder : in order that the numerical image id 1 works, you must close Gimp then reopen Gimp then open a picture. Alternatively, define the following function without parameter: Code: Select all (define (gimp-image-get-id) gimp-image-get-id Now, we can retrieve the id of the current image by the call: Code: Select all (gimp-image-get-id) 1 We can build a more generic generator of art type path based on the path of the current image of id "img": Code: Select all (define (KodiSkinPath img artType) KodiSkinPath"C:\\Tool\\Gimp\\forum\\GimpChat\\iconAlSchemist-clearart.png" With the art type 12: ![]() Code: Select all (KodiSkinPath (gimp-image-get-id) 12) "C:\\Tool\\Gimp\\forum\\GimpChat\\iconAlSchemist-spine.png" ![]() |
Author: | kittmaster [ Sat Apr 08, 2023 11:33 am ] |
Post subject: | Re: Shortening mouse/keystrokes save/export script or method to implem |
oh my... I will be having a good look at this later when I get my house duties and yard stuff done...Nice! TY! |
Author: | AlSchemist [ Sat Apr 15, 2023 5:18 pm ] |
Post subject: | KodiSave 1.1 |
Introducing KodiSave 1.1 Let us synthetize the previous posts by the complete TinyScheme script ![]() ![]() Code: Select all ; script-fu-kodi-save.scm 1.1 saves the current image as .xcf and export as .png Save KodiSave.scm in C:\Users\YourUserName\AppData\Roaming\GIMP\2.10\scripts\ replacing "YourUserName" by your Windows ![]() ![]() ___________________ Creating KodiSaveArtType.txt for art type 4 = clearart The new menu "KodiSave" is grayed at the right of the last menu "Help" while there is not any image in Gimp: ![]()
The shortcut for Gimp menu "Filter" > "Script-Fu" > "Console" is ALt+R S C ___________________ Save as .xcf and export as .png using the menu KodiSave ![]()
![]() To accelerate the process of saving and exporting, there is not any dialog box of confirmation. The Gimp status bar displays the full filename of the exported file with the art type suffix as .png ![]() Note that the saved .xcf is reloaded, then the layers are merged before exporting to .png In the above screen capture, the old variable "globalArtType" ![]() Code: Select all (KodiSkinPath (gimp-image-get-id) (ReadKodiSaveArtType)) will display the path: "C:\\Tool\\Gimp\\forum\\GimpChat\\SaveXcf-ExportPng\\iconAlSchemist-clearart.png" ___________________ Changing the art type to 12 = spine ![]() Let suppose that you wish to change the art type. Just edit KodiSaveArtType.txt in NotePad++ changing the art type by default 4 by for example 12 for "spine". You can edit KodiSaveArtType.txt at any time without reloading Gimp or selecting an option in a dialog box. You do not need to open the Script-Fu console. However, to explain the Scheme code, every function is called to demonstrate the expected result. In NotePad++, the shortcut to capture a Scheme expression in parenthesis is Ctrl+Alt+B when you are on a given parenthesis.
Tell us how are organized the 250 items in term of folders and naming convention? Are there consecutive in a given folder or in a tree of folders? Why some items are in .jpg and other in .png format? ![]() |
Author: | kittmaster [ Sat Apr 15, 2023 7:24 pm ] |
Post subject: | Re: KodiSave 1.0 |
AlSchemist wrote: Tell us how are organized the 250 items in term of folders and naming convention? Are there consecutive in a given folder or in a tree of folders? Why some items are in .jpg and other in .png format? ![]() This has been on the back of my mind, wow, the pictures look great! The naming, it "depends" on if a flat folder is used (everything in a single folder > not recommended for this) or movie by date. Without the long history and debate of one over the other, most follow movie by date format. What this means, a movie.. i.e. Aliens, Avatar, Zombieland.... etc. will have its own unique folder to "store" all of the relevant images, trailer.mp4, movie.mp4/mkv, nfo files....etc...all of that which is unique to that particular movie..will reside in a "root" folder and each movie will be named like: Movies << Root folder ........Aliens (1986) << Subfolder in Root ........Avatar (2009) << Subfolder in Root ........Zombieland (2009) << Subfolder in Root When new movies are added, more folders are added by movie name etc. TV shows follow similar formatting with the caveat that it will have subfolders to hold each "season" of that series but mirrors the Movies file structure also. So that is the naming aspect of your inquiry. Why are some jpg vs png? This is very specific to the "skin" used by Kodi, some skins will utilize all the artwork others will only use some. Anything png is required to have an alpha transparency layer and the background must be transparent. The discart, clearart, clearlogo pngs are used as overlays in movie library navigation so when you browse over the movie, the clearlogo will display center bottom. The clearart pops up when you pause the movie in the lower left and in the library info mode, the discart "spins" in from the right side of the screen. All pngs are overlayed over other layers in the skin and make for a great visual impact on the user experience and also provides key elements of what the movie is about (even though most will already know anyway, more of an experience thing). The .jpg items poster, landscape, keyart where these items do not overlay the video media itself and the user would not want to be see anything behind it, so no transparency is needed. The landscape is used in the up next module so when you are near the end of whatever media, Kodi's skin will use it as a preview of what is coming up (kind of like Netflix) and it displays the movie key elements and logo so the user can say yes or no....etc. Keyart isn't used much, but is required for some skins when it displays in different format modes such as banner, keyart, slideshows, rolling slideshow etc. So it really depends on the skin and how much the images are used, but ultimately programs like tinymediamanager, Media Companion or other apps will use sites like fanart.tv to "scrape" (download the images in the proper size and format from the website if they are present during the scape time) the data when new movies are added. It is an entire eco system of people creating the artwork.....not kidding.....for free...and free to everyone at any time. One of the true altruistic endeavors by a community that enjoys using Kodi (or other media servers that can use the artwork) as a media server for their media. While Kodi has a bad rap about illegal stuff, their charter changed. It really does a great job as a media server. Anyway, sorry for the long response, hope this helps your inquiry. ![]() |
Author: | kittmaster [ Sat Apr 15, 2023 9:27 pm ] |
Post subject: | Re: Shortening mouse/keystrokes save/export script or method to implem |
I would also mention a creature feature to help eliminate mouse clicking and typing would be for the .xcf file and exported png/jpg to pickup/use the folder name...in which....should already be named movie/tv show (date) and construct filenames based on that with the proper index concatenated. So if I was building a clearart file located in a proper movie name like: After Earth (2013) When the export is ready, it would generate the files: After Earth (2013).xcf After Earth (2013)-clearart.png I was also thinking about the index 4, makes sense in this stage, a bonus would be when the save/export is called, that all of the art types are represented with checkboxes defaulted to FALSE and when you select a single only checkmark, it uses that checkmarks index to output the appropriate file naming convention. I am looking at everything here and its a pretty sweet so far, thanks for the assist on this, it would have been very difficult to even get to where this is at now as I'm learning this from scratch. So thank you for your efforts. Chris |
Author: | kittmaster [ Sat Apr 15, 2023 10:05 pm ] |
Post subject: | Re: Shortening mouse/keystrokes save/export script or method to implem |
I'm getting this error: > (KodiSkinPath (gimp-image-get-id) (ReadKodiSaveArtType)) Error: eval: unbound variable: read-line Using Windows 10. TY. |
Author: | AlSchemist [ Sun Apr 16, 2023 6:11 am ] |
Post subject: | KodiSave 1.1 + I/O read-line |
kittmaster wrote: Error: eval: unbound variable: read-line KodiSave 1.1 + I/O read-line I forgot read-line from the I/O library powered by Richard O'Keefe in the Indiana University Bloomington repository. Because this library is included with credits in my GimpLambdaLib 0ts-stdio.scm So I removed my entire GimpLambdaLib to keep only KodiSave.scm version 1.1 pusblished in GimpChat page 1. read-line has been added at the end of this script. So you do not need to install the GimpLambdaLib. I found that the Gimp status bar is very volatile. ![]() The KodiSave message is often overwritten by any other messages if the user moves the mouse pointer. Attachment: KodiSaveWarning.png [ 80.44 KiB | Viewed 1655 times ] So, in 1.1, the KodiSave message is also displayed in the Error console even if it is not an error. To open the Gimp Error console, click Gimp menu "Windows" > "Dockable Dialogs" > "Error Console". KodiSave will display its message of export in a persistent way until you clear the Error Console. ![]() I will analyse your detailed requirements #10 and #11 soon. |
Author: | AlSchemist [ Sun Apr 16, 2023 1:54 pm ] |
Post subject: | KodiSave 1.5 with art type dialog box |
KodiSave 1.5 with dialog box for art type = clearart KodiSave 1.5 with dialog box strongly simplifies the Scheme code since the text file KodiSaveArtType.txt is no longer required. Hence the I/O library for Script-Fu has been removed. However you would select the art type in the dlgbox if you wish to change it. Code: Select all ; script-fu-kodi-save.scm 1.5 saves the current image as .xcf and export as .png or .jpg Attachment: KodiSaveClearArt1.png [ 132.15 KiB | Viewed 1645 times ] kittmaster wrote: a bonus would be when the save/export is called, that all of the art types are represented with checkboxes defaulted to FALSE and when you select a single only checkmark, it uses that checkmarks index to output the appropriate file naming convention. Checkboxes in Gimp Script-Fu are defined by SF-TOGGLE. However the user could check more than one art type. I prefer a listbox more easier to be coded in only one line since the vector of art type already exists since version 1.0 ![]() Code: Select all SF-OPTION "Art type" (vector->list vKodiArtSuffix)
![]() _____ Attachment: KodiSaveClearArt2.png [ 142.26 KiB | Viewed 1645 times ] Once you confirmed the saving of .xcf and the export to .png:
|
Author: | AlSchemist [ Sun Apr 16, 2023 2:12 pm ] |
Post subject: | Next movie |
Next movie Attachment: KodiSavePoster1.png [ 27.39 KiB | Viewed 1645 times ]
art type = poster Attachment: KodiSavePoster2.png [ 138.01 KiB | Viewed 1645 times ]
poster => .jpg Attachment: KodiSavePoster3.png [ 163.55 KiB | Viewed 1645 times ]
Note: saving a picture in .jpg destroys a little bit its quality at each saving. ![]() Code: Select all (file-jpeg-save RUN-NONINTERACTIVE imgSkin layerSkin fullSkin fullSkin 0.97 0 TRUE FALSE "" 1 FALSE FALSE 2) In the Script-Fu console if you click the Browse button for the function file-jpeg-save, you could read its help: Code: Select all (file-jpeg-save run-mode image drawable filename raw-filename quality smoothing optimize progressive comment subsmp baseline restart dct) quality = 0.97 More the quality is close to 100% more the .jpg is big. Tune other parameters since I never save in .jpg format. I prefer the Google format Web Photo: .webp ![]() Once you saved .xcf and exported .png or .jpg according to the art type, do you go to the next movie or you prefer to keep the current image in the Gimp editor for example to improve the .xcf Give details how you switch between movies. Do you wish to persist the shape of the last selection between two movies? ![]() What kind of basic editing could be scripted? ![]() |
Author: | kittmaster [ Sun Apr 16, 2023 9:10 pm ] |
Post subject: | Re: Shortening mouse/keystrokes save/export script or method to implem |
I just gave it a whirl....very nice...easy to use. I made some changes to the array image types, see code below. I also moved the location to the file menu as that is where I would put it (I understand current location makes access easy) For the FanartSharp, the # sign is actually used for a place holder to support multiple fanart images as there can be more than one. There is always fanart.jpg.... always, media companion (which I use) offers up to 10 additional.... so there should/could be up to 10 more images in the folder. So it would look like fanart1.jpg, fanart2.jpg, fanart3.jpg, fanart4.jpg......and so on. So I think it would need a modification so if in the pulldown you select fanart for the output of the image, then it enables a spinner. If 0, then fanart.jpg, 1 fanart1.jpg, 2 fanart2.jpg......and so on. Not sure how easy that is implemented, but that is how the naming was established via kodi. The link is working now: https://kodi.wiki/view/Artwork_types#fanart# https://kodi.wiki/images/7/7c/LocalTVShowArtwork01.jpg When export is complete, switching to the next movie, I found myself closing all the files and starting a manual selection of the next movie. Most of this is done in a sandbox before moving to a storage NAS because trying to do it live could cause errors and that would be a bad thing. So once save/export is done, that is where it should stop. I will think about the workflow a bit more and update if it makes sense to modify or leave as is. The only other thought would be, the "bar" that shows status...is there a way to have a text label that says something like "Save Status:" above it? I was thinking having a message prior to saving "Waiting for User Selection"... after options are selected... then it updates as it does now. If not, no issue, just thinking out loud. Let me think about the basic editing inquiry, that requires a bit of A > B > C > D thinking before I can make a suggestion there. Marvelous work!! ![]() ![]() EDIT: My modified code: Code: Select all ; script-fu-kodi-save.scm 1.2 saves the current image as .xcf and export as .png |
Author: | AlSchemist [ Thu Apr 20, 2023 3:21 pm ] |
Post subject: | KodiSave 1.3 FanArt# |
KodiSave 1.3 FanArt# See above the updated source code 1.3. ![]() kittmaster wrote: I also moved the location to the file menu as that is where I would put it You are no longer a rookie ![]() Great learning! ![]() kittmaster wrote: the "bar" that shows status...is there a way to have a text label that says something like "Save Status:" above it? ...having a message prior to saving "Waiting for User Selection"... after options are selected... It is too ambitious ![]() ![]() ![]() ![]() There is not any event fired ![]() Code: Select all (script-fu-kodi-save img layer artTypeIdx fanArtNbr) kittmaster wrote: enables a spinner. If 0, then fanart.jpg, 1 fanart1.jpg, 2 fanart2.jpg Code: Select all SF-ADJUSTMENT "FanArt only" '(0 0 30 1 10 0 0) Attachment: KodiSaveFanArt0.png [ 125.94 KiB | Viewed 1616 times ] By defaut the FanArt only numerical suffix is zero: Attachment: KodiSaveFanArt0saved.png [ 120.74 KiB | Viewed 1616 times ] it is not added after "-fanart". Attachment: KodiSaveFanArt1.png [ 133.93 KiB | Viewed 1616 times ] If the user clicks on the upper arrow of the spinner or moves the cursor, ![]() FanArt only numerical suffix is added after "-fanart" and before the file extensionn ".jpg" Finally, pay attention to the underscore ![]() Code: Select all (script-fu-register "script-fu-kodi-save" "_KodiSave" "KodiSave V1.3" "AlSchemist" It enables the shortcut Alt+File > KodiSave. ![]() |
Author: | kittmaster [ Sat Apr 22, 2023 7:51 am ] | |||
Post subject: | Re: Shortening mouse/keystrokes save/export script or method to implem | |||
The revision is exactly what I was looking for it to do... ![]() ![]() I gave it some exercise, it did generate one unexpected result and I can't replicate it, but figure I post it so you can see what I ran into and if you may have an idea what might have caused it. I took an image from my NAS collection. It was the landscape image of Aliens (1986). I renamed it to "Aliens Horizontal image.jpg" for the sake testing. I created a folder on my desktop: Aliens (1986) ----> Just as it would be as expected from intent of this script. The order I tried before I noticed the issue: --- I loaded the image in GIMP --- Exported Landscape -> OK --- Exported Actor -> OK --- Exported Fanart - Spinner set to 6 -> Failed, added suffix unexpectedly as fanart5.XXXXXXX -> continue --- Exported Fanart - Spinner set to 5 -> OK --- Exported Fanart - Spinner set to 6 -> OK Deleted all images except starting image "Aliens Horizontal image.jpg" Replicated steps above, no issue all exported OK. Not sure how to replicate this issue, only happened once thus far, so I'll try to track it, but figured I'd provide feedback incase you may have an idea what generated the issue. It seems like an initialization variable may be needed set to 0? I was going to take a look to see if I can manage that, but not sure as of this writing. Other than that, this thing is excellent and amazed with the outcome, thank you again for the efforts, reading the code helps me a bit more to understand how scheme works. Never used this language before, so it is a good learning experience. ![]() ![]() Chris
|
Author: | kittmaster [ Sat Apr 22, 2023 8:11 am ] | ||
Post subject: | Re: Shortening mouse/keystrokes save/export script or method to implem | ||
Also forgot to mention, it seems to be warning me every time it exports even though it works as expected. I did a normal export and it didn't flag any warnings. Have no idea what would cause that, but noticed the behavior.
|
Author: | AlSchemist [ Sun Apr 23, 2023 9:45 am ] |
Post subject: | KodiSave 1.4 FanArt# as integer |
KodiSave 1.4 FanArt# as integer See above the updated source code 1.4. ![]() kittmaster wrote: be warning me every time it exports even though it works as expected This behavior is by design. Since, the KodiSave message in the status bar could disappear, we use the Error window to persist the message as a warning even if it is not a warning or an error. If you do not wish any message in the Error window, put in comment adding ";" in the beginning of the line 154: Code: Select all (gimp-message (string-append "KodiSave: " fullSkin)) Alternatively, if you do not wish to put in comment gimp-message, you can delete this line. kittmaster wrote: Exported Fanart - Spinner set to 6 -> Failed, added suffix unexpectedly as fanart5.XXXXXXX Do you remember if you moved the cursor or clicked to upper arrow of the spinner? For unknown reason ![]() ![]() To fix the issue:
How to convert a float to an integer in Script-Fu? You can copy and paste the following code in the Script-Fu console. Code: Select all (trunc (round 5.7073)) 6 The boundary is at the half of the interval between 5.0 and 6.0: 5.5 Code: Select all (trunc (round 5.5)) 6 Code: Select all (trunc (round 5.4)) 5 Into the bargain, if there is a decimal dot in the conversion from number to string, we split the string with the known function strbreakup used to split a filename into a root and a file extension: Code: Select all (car (strbreakup (number->string 5.7073 10) ".")) "5" You can try without the function car to get the list of the numbers before and after the decimal dot: Code: Select all (strbreakup (number->string 5.7073 10) ".") ("5" "7073") Finally, if the issue occurs too often, put in comment adding ";" in the beginning of the line "SF-ADJUSTMENT". Then remove ";" in the line below starting with "SF-VALUE". The spinner will be replaced with an input box initialized with "0". Before: with the spinner Code: Select all SF-ADJUSTMENT "FanArt only" '(0 0 30 1 10 0 1) After: without the spinner but a basic input box Code: Select all ; SF-ADJUSTMENT "FanArt only" '(0 0 30 1 10 0 1) In the free editor NotePad++, adding ";" in the beginning of the line renders the line as a green comment. ![]() After the editing of a Script-Fu source code .scm such as KodiSave.scm, we recommend to close Gimp then restart Gimp even if there is the menu "Filter" > "Script-Fu" > "Refresh scripts". So we are sure that the memory used by Script-Fu will be correctly released. ![]() |
Page 1 of 3 | All times are UTC - 5 hours [ DST ] |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |