Switch to full style
Post all Gimp scripts and script writing questions here
Post a reply

Calendar month and year plugin (script .scm) updated - modified

Sat Oct 07, 2023 1:54 am

Origin:
The original script is from https://www.gimphelp.org/other_calendar_month.html (I have it from ages)
Then recently I discovered the same but with the possibility for the year to chose from month to month https://www.gimpscripts.net/2020/12/sg-calendar.html this later script has no Ctrl+Z capabilities (I did try to fix it, but nope I got more errors) and can be buggy as well as you do need to go to Select > None after that script did run)

Why:
It all started when I tried the script from gimpscripts, I saw there was a Russian version in this script, I told myself, "it misses the Ukrainian language!".
Then I just wanted to add a slider or two and change some default values and extend the max year on the one I did have from gimphelp, then testing it many times, I did many things to suit my needs like changing some others default values, then finally add the Ukrainian language, fixing a bug in the "Date position" as it was a mess in the drop-down list about the order, changing labels to be more specific as my test gave me a better understanding how it works, etc... (once I was in, I couldn't stop :hehe )

So two scripts -> which one:
I did work and tested thoroughly on the one from gimphelp sg-calendar-from-gh-210.scm, and just reported few changes on the other one sg-calendar-from-gs.scm, I did took some translations from the later that sg-calendar-from-gh-210.scm did not have, add also Ukrainian to the one from gimpscripts...
But overall this one -> sg-calendar-from-gh-210.scm is the one I use, is less buggy (maybe a point of view?), has the Ctrl+Z option working, and left the canvas without an active selection thus I like it better -> for sure it's just because I did all with it that I like it better :hehe , I'm not fair at this point.
On the other hand -> sg-calendar-from-gs.scm can make a year calendar from a month and ends to another month that you chose, where the other one gives you a full year. And let's face it, I just reported few things on it, not really doing things, and just tried it not fully testing it! Thus I don't really know this one.

I'm not a programmer:
I did not touch the core code, nor algorithms, etc... I did made a lot of changes from line 1 to 176 and from 761 to 812 in sg-calendar-from-gh-210.scm.
THUS, the usual warning -> if you download those scripts, you should know that they WILL BURN your computer, maybe your house with it...
So if you want to keep your car, park it outside of your garage, two or three blocks away from your house.

Both scripts are inside, you should not put them together, but I did some slight changes and they can be installed together in the script directory/folder.
On the menu Filters > Render > Calendar > (the entries starting with "Gs" is the script from gimpscript)
calendars.7z
(11.91 KiB) Downloaded 55 times


Example Year 2077
Image

Example January 2099
Image

Few things to know that can help:
There is an option called "Right Justify:...", this option affect only the numbers composed with one digit only -> if UNchecked, numbers 1 to 9 will be aligned vertically on the first digit of the numbers with 2 digits.
See?
screenshot_20231007-103134.jpg
screenshot_20231007-103134.jpg (140.81 KiB) Viewed 1124 times


When checked this option will align vertically the numbers composed with 1 digit, in the middle of the numbers composed with 2 digits
See?
screenshot_20231007-103354.jpg
screenshot_20231007-103354.jpg (155.84 KiB) Viewed 1124 times


Also the "Padding" in the year calendar (only in the year), will increase the space of the banner for the month's name, as well as the space BETWEEN rows, but it has a counter effect, it will decrease the size of the month's grids.
Roughly a month's name cannot be larger than the month's grid (see November/December, the biggest names), thus when a big name reach the wideness of its grid, if you continue to increase the Padding, this will start to add more space between rows -> thus decreasing the size of the months grid even faster -> as a name cannot be bigger that its grid -> now also decrease the month's name and increase even more the space between rows.
I don't know if you understand my explanations... but I discovered this during my tests. I found it quite genius once I understood, tough, but you should understand how it works, it's quite simple :mrgreen:

Padding at 10 100% view
Image

Padding at 30 100% view (see the month's grid already decrease while the month's names did increase
Image

You will find bugs, ants, and maybe some fishes!
Please I can only help (a very little) with sg-calendar-from-gh-210.scm, that's the only one I truly tested up to the other side of our galaxy.

Re: Calendar month and year plugin (script .scm) updated - modified

Sat Oct 07, 2023 3:09 am

First step of becoming a programmer, in spite of your reluctance...
Welcome!

Re: Calendar month and year plugin (script .scm) updated - modified

Sat Oct 07, 2023 4:17 am

Hats off to you for playing with the scm format!

Re: Calendar month and year plugin (script .scm) updated - modified

Sat Oct 07, 2023 9:28 pm

dinasset wrote:First step of becoming a programmer, in spite of your reluctance...
Welcome!

:rofl :rofl

Skinnyhouse wrote:Hats off to you for playing with the scm format!

I know absolutely nothing in Python, but I found python "easier"/ more readable could be the word, maybe because from my point of view, Python looks a lot more human ;)

Thank you very much Diego and Skinnyhouse for your kind words. :tyspin

Re: Calendar month and year plugin (script .scm) updated - modified

Sun Oct 08, 2023 1:52 am

Patrice, you have given a great step to much more. Congrats!
I'll test it. I'll do my next planning with your plug-in. Thanks :clap :tyspin

Re: Calendar month and year plugin (script .scm) updated - modified

Sun Oct 08, 2023 2:10 am

PixLab wrote:
dinasset wrote:First step of becoming a programmer, in spite of your reluctance...
Welcome!

:rofl :rofl

Skinnyhouse wrote:Hats off to you for playing with the scm format!

I know absolutely nothing in Python, but I found python "easier"/ more readable could be the word, maybe because from my point of view, Python looks a lot more human ;)

Thank you very much Diego and Skinnyhouse for your kind words. :tyspin

Second step towards entering programming: comparing script-fu and python and selecting python. Go on... :gimp

Re: Calendar month and year plugin (script .scm) updated - modified

Sun Oct 08, 2023 9:30 pm

dinasset wrote:Second step towards entering programming: comparing script-fu and python and selecting python. Go on... :gimp


Happily that I was not drinking some coffee while reading :rofl :rofl
I literally bursted into laughter
Thanks a lot for the laughter, Diego, that were very good ones :yes

Re: Calendar month and year plugin (script .scm) updated - modified

Sun Oct 08, 2023 9:52 pm

Issabella wrote:Patrice, you have given a great step to much more. Congrats!
I'll test it. I'll do my next planning with your plug-in. Thanks :clap :tyspin


Thank you very much Issabella for your kind words, do not hesitate if you see a problem (no sure I can solve it, though, but find some "trick" solution, yes it's possible)
:tyspin

Re: Calendar month and year plugin (script .scm) updated - modified

Thu Oct 19, 2023 8:37 pm

My instinct would be to do this kind of thing as a plugin for Inkscape rather than GIMP. Why? Because it’s the kind of thing that you might want to edit/tweak by hand after it’s been generated. Inkscape documents are SVG, as you may know, and SVG is resolution-independent, so you can do this kind of editing without loss of quality. You can include the GIMP graphic (or any other graphic) as a background layer.

Re: Calendar month and year plugin (script .scm) updated - modified

Thu Oct 19, 2023 10:23 pm

ldo wrote:My instinct would be to do this kind of thing as a plugin for Inkscape rather than GIMP. Why? Because it’s the kind of thing that you might want to edit/tweak by hand after it’s been generated. Inkscape documents are SVG, as you may know, and SVG is resolution-independent, so you can do this kind of editing without loss of quality. You can include the GIMP graphic (or any other graphic) as a background layer.


No need, it exists in Inkscape, just go to the top menu Extensions > Render > Calendar...
screenshot_20231020-102304.jpg
screenshot_20231020-102304.jpg (140.46 KiB) Viewed 864 times


On a side note:
Not everyone is willing to learn both GIMP and Inkscape.
And what about not savvy computer users who knows only GIMP.
On different forums or reddit, some people said it's better to do it in LibreOffice/Calc or Writer, so for them even Inkscape is not good enough... ;)

Re: Calendar month and year plugin (script .scm) updated - modified

Thu Oct 19, 2023 10:59 pm

I wouldn’t do it in LibreOffice anything. You want a proper design/layout tool, which means something like the align/distribute functions in Inkscape. GIMP is more for your painterly pixel-oriented imagery.

Re: Calendar month and year plugin (script .scm) updated - modified

Fri Oct 20, 2023 12:33 pm

Anyway, the script exists for GIMP, so I find it nice of Pixlab to give it a little love and update it (and maybe start his programming for GIMP career this way).
Nobody must use it, if they find other ways.
But It's nice to have.

Re: Calendar month and year plugin (script .scm) updated - modified

Sat Oct 21, 2023 1:22 am

nelo wrote: (and maybe start his programming for GIMP career this way)

:hoh

:rofl :rofl :rofl

Thank you nelo for the kind words and the laughter :bigthup
Post a reply