Author Topic: APP: nanogallery2 generator  (Read 673 times)

axel.hennig

  • Full Member
  • **
  • Posts: 219
APP: nanogallery2 generator
« on: April 06, 2022, 10:46:19 PM »
Hi all,

please find attached a "nanogallery2 generator" app. Back in the (very) old IMatch times there was a script to produce a Juicebox-gallery. This app is designed to be a replacement.

The app is designed to produce a gallery to be used mostly offline, not online. For an app to create a webpage to be used online I suggest to use Jingos Online Gallery Creator... with FTP!.

The zip-file contains a readme.pdf with some instructions as well as a sample gallery to have a look how the final result could look like.

Final remark: Once the app is finished with the creation process there is one last step which needs to be done outside of IMatch (described in detail in the readme.pdf).

Enjoy.

PS: All images/videos are from https://www.pexels.com/ (free stock photos, royalty free images & videos).
« Last Edit: April 06, 2022, 10:50:53 PM by axel.hennig »

ubacher

  • Oldtimer
  • ****
  • Posts: 2521
Re: APP: nanogallery2 generator
« Reply #1 on: April 07, 2022, 07:27:46 AM »
Tried it out, works like a charm.

( I used Irfanview Batch resizing for the thumbs, copied originals into the media_large)

Thank you

Mario

  • IMatch Developer
  • Administrator
  • *****
  • Posts: 31554
Re: APP: nanogallery2 generator
« Reply #2 on: April 07, 2022, 08:29:18 AM »
Thanks for sharing  :)

axel.hennig

  • Full Member
  • **
  • Posts: 219
Re: APP: nanogallery2 generator
« Reply #3 on: April 07, 2022, 08:45:15 AM »
Tried it out, works like a charm.

Happy to hear that.

sinus

  • Global Moderator
  • *****
  • Posts: 4707
  • IMatch-User since 2001 (IMatch 3.6)
Re: APP: nanogallery2 generator
« Reply #4 on: April 07, 2022, 09:14:12 AM »
Thanks, Axel,
your sample looks cool!
And thanks for sharing.  :D


I guess, I do something wrong, because ubacher could let it run.

I cannot enter a category-field.
Your app runs fine, the tree to choose a category opens and I can click on a category, but it does not appear (like the output-folder).
Then I thought, ok, the category is maybe choosen, but simply hidden in the field.

But after clicking on the green button to generate the gallery, I get some infos, but nothing happens further.
Also the output - folder is empty, hence I cancelled the app.

For testing I have only some files in the categories, about 10 or so (jpgs).

THANKS for the excellent manual, cool!
What I wonder is, what is this comment about "not for online"?
If the gallery once online, would I am able to copy the whole stuff on my handy and let it run there (not online)?

And the last question:
For creating the thumbs and jpgs ... could we do this not using, after closing your app, the batch-converter from IMatch?
I attaches some screenshots, but I am sure, I do something wrong.  8)


Best wishes from Switzerland! :-)
Markus

axel.hennig

  • Full Member
  • **
  • Posts: 219
Re: APP: nanogallery2 generator
« Reply #5 on: April 07, 2022, 09:34:43 AM »
I cannot enter a category-field.
Your app runs fine, the tree to choose a category opens and I can click on a category, but it does not appear (like the output-folder).
Then I thought, ok, the category is maybe choosen, but simply hidden in the field.

Hmmm, don't know why this is not working. I had this once for one specific category. But I was able to choose another category. Could you please try the following two things:
  • Run the app and choose any other category compared to the one you've choosen before. Don't let the app run, just check if the field "Input Category" gets filled.
  • Rename your "nanogallery2" category to something different and try again if you're able to choose that category.

What I wonder is, what is this comment about "not for online"?

The app pre-loads all albums when you open the "index.html". Normally you wouldn't do that on a webpage. There you would just load the album you want to look at. But offline this is not possible, because all modern browsers block loading local files for good reasons. Therefore I had to come up with another solution (loading everything in advance). This solution might be slow on webservers (and maybe also on slow PCs).

For creating the thumbs and jpgs ... could we do this not using, after closing your app, the batch-converter from IMatch?

Yes, I think so. More or less only reason why I decided to do that "outside" of IMatch is because I also want to use nanogallery2 for videos and therefore thumbnail-conversion and video-conversion is a little bit more difficult.

sinus

  • Global Moderator
  • *****
  • Posts: 4707
  • IMatch-User since 2001 (IMatch 3.6)
Re: APP: nanogallery2 generator
« Reply #6 on: April 07, 2022, 12:23:17 PM »
I cannot enter a category-field.
Your app runs fine, the tree to choose a category opens and I can click on a category, but it does not appear (like the output-folder).
Then I thought, ok, the category is maybe choosen, but simply hidden in the field.

Hmmm, don't know why this is not working. I had this once for one specific category. But I was able to choose another category. Could you please try the following two things:
  • Run the app and choose any other category compared to the one you've choosen before. Don't let the app run, just check if the field "Input Category" gets filled.
  • Rename your "nanogallery2" category to something different and try again if you're able to choose that category.


Thanks for your answers, I understand this now (why not online).

I tried this before, I can add new categories or choose others, plain categories, with formulas, old categories, does not matter, the field stays empty.

But I have just realize, I am still on 2021.14.4, which means one version behind the actual one from IMatch.  :-[
I do not think, that this is a reason, but I will update IMatch in one or two hours and try again your app.

Because, this seems really to be a cool app.  :)

But do not waste too much time for this, after all, on ubacher's machine your app runs smooth, and until now, only here not. Could be also something on my computer.
After I have updated IMatch and tried again, I will report here again.
 
Best wishes from Switzerland! :-)
Markus

Jingo

  • Super Hero
  • ****
  • Posts: 1972
Re: APP: nanogallery2 generator
« Reply #7 on: April 07, 2022, 01:08:57 PM »
Thanks for the APP share... looks really cool.  I still use my Gallery App on an ongoing basis to share photos with family and friends using my online host - always nice to have an offline option though too.

For the last manual step - you should be able to easily create these thumbnails from within the app using command line calls along with ImageMagick... check out my latest APP where I do this to create a temp JPG to gather estimate out size... ImageMagick allows all sorts of resize parameters so creating two additional files during export should be quite easy and then users would not need to manually do any work.

Thx again...Andy.

sinus

  • Global Moderator
  • *****
  • Posts: 4707
  • IMatch-User since 2001 (IMatch 3.6)
Re: APP: nanogallery2 generator
« Reply #8 on: April 07, 2022, 02:35:12 PM »
Axel, I have updated to 2021.15.2  :D

But unfortunately the category-field stays empty, does not matter, what I select for categories.

But as Jingo has written something, it seems to work there too, hence it could be simply my machine.
Hence I would do nothing, maybe other users does also try your app.

Jingo made a suggestion for the jpgs, what must be created.
But the only thing, what I like generelly not, that we have then to install something (ImageMagick). Sometimes I think, we have to install this and that app, what drives me sometimes crazy.  8)

I used ImageMagick some years ago, a fine tool, with success. Nevertheless, if this nanogallery-app once runs on my computer, then I will use to create (at least try) the Batch-processor of IMatch.
Best wishes from Switzerland! :-)
Markus

axel.hennig

  • Full Member
  • **
  • Posts: 219
Re: APP: nanogallery2 generator
« Reply #9 on: April 07, 2022, 04:00:07 PM »
But unfortunately the category-field stays empty, does not matter, what I select for categories.

Sorry sinus, I just don't know why it is not working. Will try to solve this, just because I would like to understand what's going on.

To be clear: Selecting a category means that you have to click into the square on the left. A "plus" will appear. See my screenshot.

I've also changed one line of code (starting from line 211) in the index.html. Instead of options: 'singlesel' it is now options: 'default,singlesel'. See also below.

Code: [Select]
IMatch.categoryBrowser({
    options: 'default,singlesel'
}).then(response => {
    inputCatId = response.id[0];
    $('#inputCategory').text(response.categories[0]);
});

Maybe this helps in solving your problem.

But the only thing, what I like generelly not, that we have then to install something (ImageMagick).

I fully agree. Therefore I'm currently looking if this is somehow achievable within IMatch or by just adding a batch command-line exe to the app that runs fully automatic at the end...

sinus

  • Global Moderator
  • *****
  • Posts: 4707
  • IMatch-User since 2001 (IMatch 3.6)
Re: APP: nanogallery2 generator
« Reply #10 on: April 07, 2022, 04:31:22 PM »
But unfortunately the category-field stays empty, does not matter, what I select for categories.

Sorry sinus, I just don't know why it is not working. Will try to solve this, just because I would like to understand what's going on.

To be clear: Selecting a category means that you have to click into the square on the left. A "plus" will appear. See my screenshot.

Success!  :)

Cool, Axel, thanks a lot and I am very sorry, I am contrite about my stupidity.  :-[

You sentence above and you attachment made it clear.
I clicked NOT on the sqare, I clicked on the category itself (like I do in IMatch).

And I did your small change to the index-file, it works with the changed line and I checked also, it works also with the "old" line.

I did a short test and did the small jpgs with photoshop (in the two folders) and WOW, cool, very good!

Thanks a lot for your help and assistance and for sharing the app.
 :D

update: and btw, you made a nice icon for the app
Maybe I can not show some images to my family better with this app ... Easter ist coming
« Last Edit: April 07, 2022, 04:35:03 PM by sinus »
Best wishes from Switzerland! :-)
Markus

axel.hennig

  • Full Member
  • **
  • Posts: 219
Re: APP: nanogallery2 generator
« Reply #11 on: April 07, 2022, 05:35:20 PM »
@sinus: happy to hear that it's working.

sinus

  • Global Moderator
  • *****
  • Posts: 4707
  • IMatch-User since 2001 (IMatch 3.6)
Re: APP: nanogallery2 generator
« Reply #12 on: April 07, 2022, 05:50:08 PM »
me too!

Thanks, now I can "explore" your app!  :)
Best wishes from Switzerland! :-)
Markus

ubacher

  • Oldtimer
  • ****
  • Posts: 2521
Re: APP: nanogallery2 generator
« Reply #13 on: June 29, 2022, 07:06:19 PM »
I tried the gallery some more - with more files.
On the thumbnail page I get a maximum of three lines even if enough space is available.
And there is no way to scroll the thumbs page.
Are these known limitations?

axel.hennig

  • Full Member
  • **
  • Posts: 219
Re: APP: nanogallery2 generator
« Reply #14 on: June 30, 2022, 08:42:11 AM »
Hi ubacher,

I wouldn't call this a limitation. This is just the "initial setting". You can easily change this:

  • If you have already created a gallery: Go to the output-folder. There must be a sub-folder called "media_js". Open all files within this folder with a texteditor (e.g. Notepad++) and change line 6 from "galleryDisplayMode: 'rows'," to "galleryDisplayMode: 'fullContent',"
  • If you want to change this prior to gallery-creation: Go into the app-folder. Within the sub-folder "templates" open the file "dynamic_album.js" and change line 5 accordingly.

All possible settings for "galleryDisplayMode" (and all the other settings) can be found here: https://nanogallery2.nanostudio.org/documentation.html

Hope this helps.