Posts:
789
Registered:
13-Apr-2006
|
|
|
|
Re: Reduce size of .json files
Posted:
31 Mar 25, 11:16
in response to: ming666
|
|
|
It does shorten for pictures and folders. Here all comments are for pictures. F:\My Albums\Master\2025 01 24 Norge\2025 01 24 Norge\2025 01 24 Hahnstätten - Helsingør\data1.json (8 Treffer)
Zeile 51: "comment":"Die Bauarb...",
Zeile 92: "comment":"Ein andere...",
Zeile 133: "comment":"Die Bauarb...",
Zeile 174: "comment":"Die Bauarb...",
Zeile 215: "comment":"Eine ander...",
Zeile 257: "comment":"Eine ander...",
Zeile 304: "comment":"Die Küste ...",
Can you pass a data1.json here to inspect it? You can ZIP/RAR or what ever to shrink it in size.
|
|
|
Posts:
90
Registered:
27-Aug-2019
|
|
|
|
Re: Reduce size of .json files
Posted:
31 Mar 25, 11:19
in response to: MarkusD
|
|
|
|
|
|
Posts:
789
Registered:
13-Apr-2006
|
|
|
|
Re: Reduce size of .json files
Posted:
31 Mar 25, 11:38
in response to: ming666
|
|
|
|
|
|
It seems you have 624 pictures (objects) in just one folder. That is a lot. I would reduce it to 200 or better to 100.
Attached is my file:
C:\Program Files\jAlbum\skins\Tiger\init.js
Compare it to yours. Do they match?
|
|
|
Posts:
90
Registered:
27-Aug-2019
|
|
|
|
Re: Reduce size of .json files
Posted:
31 Mar 25, 11:41
in response to: MarkusD
|
|
|
It seems you have 624 pictures (objects) in just one folder. That is a lot. I would reduce it to 200 or better to 100.
Attached is my file:
C:\Program Files\jAlbum\skins\Tiger\init.js
Compare it to yours. Do they match?
Oh there's going to be more than 624. Up to 1,200. That's what I need and they all need to be in one folder. I'm using it as an exhibition of works of art and this is a single exhibition
Tiger just updated so it will have overwritten my init files.
I'll try yours
Edit: OK I tried yours in the program file folder and it didn't work
I added it to the app data folder and tried again and it worked. It has halved the size on the data1.json file
Thanks for that
Are there ramifications on search or anything else?
Edited by: ming666 on 31 Mar 2025, 11:48
|
|
|
Posts:
789
Registered:
13-Apr-2006
|
|
|
|
Re: Reduce size of .json files
Posted:
31 Mar 25, 12:05
in response to: ming666
|
|
|
Edit: OK I tried yours in the program file folder and it didn't work
I added it to the app data folder and tried again and it worked. It has halved the size on the data1.json file
Finally.
Are there ramifications on search or anything else?
Having several hundred or even more than thousand objects in one folder is just a mess, if you ask me. Aren't there any categories you can put your pictures in several folders? Categories like when these things were made or what ever.
Browsing through these pictures is just a nightmare if you want to read all the comments. I think you used the complete wrong skin or technique for your task. If I would have to browse through the pictures, I would stop after 5 or 6.
What you need is something where you can scroll through you pictures by just using the scroll wheel of the mouse (or <key left>/<key right>) and have the comment visible side by side to the picture. Of course this will not work on smartphones or tablets. Which does not make sense anyway at the moment because of all the text.
I've never really used the other skins, not sure which one to use for your task.
|
|
|
Posts:
90
Registered:
27-Aug-2019
|
|
|
|
Re: Reduce size of .json files
Posted:
31 Mar 25, 12:42
in response to: MarkusD
|
|
|
Edit: OK I tried yours in the program file folder and it didn't work
I added it to the app data folder and tried again and it worked. It has halved the size on the data1.json file
Finally.
Are there ramifications on search or anything else?
Having several hundred or even more than thousand objects in one folder is just a mess, if you ask me. Aren't there any categories you can put your pictures in several folders? Categories like when these things were made or what ever.
Browsing through these pictures is just a nightmare if you want to read all the comments. I think you used the complete wrong skin or technique for your task. If I would have to browse through the pictures, I would stop after 5 or 6.
What you need is something where you can scroll through you pictures by just using the scroll wheel of the mouse (or <key left>/<key right>) and have the comment visible side by side to the picture. Of course this will not work on smartphones or tablets. Which does not make sense anyway at the moment because of all the text.
There are categories but even if I did that I would need a page where people could see everything on one page. Most people will not be reading all the comments, they will be browsing the photos and looking at the comments on the ones that interest them. This is in conjunction with a separate narrative that talks about every piece, with links directly to that piece.
Think of it like an index/appendix for a book. It is not a stand alone thing. They are in the order in which they are mentioned in the narrative.
BTW people can scroll through the main page with the mouse wheel and scroll through the image pages with the left and right keys
Auction houses routinely have hundreds of lots on one page without comments until you go into the page for the lot. The people looking at this are used to viewing auctions online.
|
|
|
Posts:
90
Registered:
27-Aug-2019
|
|
|
|
Re: Reduce size of .json files
Posted:
31 Mar 25, 12:44
in response to: ming666
|
|
|
|
Thank you BTW.
I did write that earlier but it got corrected to "That's for that"
|
|
|
Posts:
789
Registered:
13-Apr-2006
|
|
|
|
Re: Reduce size of .json files
Posted:
31 Mar 25, 12:48
in response to: ming666
|
|
|
Thank you BTW.
I did write that earlier but it got corrected to "That's for that"
You are welcome.  It's rare that I can help with something. 
|
|
|
Posts:
8,088
Registered:
31-Jan-2006
|
|
|
|
Re: Reduce size of .json files
Posted:
31 Mar 25, 14:01
in response to: MarkusD
|
|
|
|
Let's clarify a couple of things....
First, in order to incorporate a function that allows site visitors to search the information, a database of some sort is required, something that a Javascript routine can parse. In short, a JSON file. My skins don't use a JSON file, but they don't include any search capability, either. You can't have one without the other.
Second, any text you remove from the JSON file, by using some sort of special script that cuts them short, will no longer be discoverable by the search function. If the part of the description that gets left out includes the word "shazzam," a search for "shazzam" won't find that description.
There's no magic.
|
|
|
Posts:
90
Registered:
27-Aug-2019
|
|
|
|
Re: Reduce size of .json files
Posted:
31 Mar 25, 15:02
in response to: JeffTucker
|
|
|
Let's clarify a couple of things....
First, in order to incorporate a function that allows site visitors to search the information, a database of some sort is required, something that a Javascript routine can parse. In short, a JSON file. My skins don't use a JSON file, but they don't include any search capability, either. You can't have one without the other.
Second, any text you remove from the JSON file, by using some sort of special script that cuts them short, will no longer be discoverable by the search function. If the part of the description that gets left out includes the word "shazzam," a search for "shazzam" won't find that description.
There's no magic.
So this is what I was asking earlier.
If this is the case the shortening of the files isn't much good to me
and can confirm, it breaks the search function
Edited by: ming666 on 31 Mar 2025, 15:06
|
|
|
Posts:
8,088
Registered:
31-Jan-2006
|
|
|
|
Re: Reduce size of .json files
Posted:
31 Mar 25, 17:35
in response to: ming666
|
|
|
A couple of parting thoughts....
The albums produced by jAlbum are all client-side. In other words, no processing is done on the server. Everything that's needed to display the album is statically downloaded to the visitor's PC, and then Javascript routines handle whatever "massaging" needs to be done. This generally works perfectly well, but when albums are asked to support searching of huge databases, this becomes cumbersome, or even unworkable.
The alternative is to use gallery software that is server-side. In that case, searching is done on the server, not on the visitor's PC, so no huge database has to be downloaded. jAlbum is manifestly not that software, and probably never will be.
MarkusD's use of comment fields to contain large amounts of HTML material is a different issue. The skins aren't geared to handle that sort of thing gracefully. I would be more inclined to use sidecar files to contain all that material. The jAlbum comment could then contain just a "More Info" button that would link to that other material.
In a skin that uses a lightbox script with an extensive API, you could have that button launch a new instance of the lightbox, with the more detailed content displayed in it. Laza's skins, however, use his own home-brewed lightbox script, so AFAIK, there is no API that you can tap into.
In my skins, the icons that display metadata and maps are doing just that - they trigger a new instance of the same lightbox software that's used to show the slide images, but as "one-off" displays, not part of a linked gallery, with content fed to them. Example:
https://jefftucker.jalbum.net/skins/neptune/maps/
|
|
|
Posts:
789
Registered:
13-Apr-2006
|
|
|
|
Re: Reduce size of .json files
Posted:
31 Mar 25, 19:03
in response to: JeffTucker
|
|
|
MarkusD's use of comment fields to contain large amounts of HTML material is a different issue. The skins aren't geared to handle that sort of thing gracefully. I would be more inclined to use sidecar files to contain all that material. The jAlbum comment could then contain just a "More Info" button that would link to that other material.
Just a short explanation (as a video) how I use long comments (only for folders) and that I'm perfectly fine with the fact, that these comment are not part of the JSON files.
https://www.markus-drueck.de/public/jAlbum/Videos/jAlbum%20Core/index.html#img=Video_2025-03-31_182209.mp4
Cheers, Markus
|
|
|
Posts:
8,088
Registered:
31-Jan-2006
|
|
|
|
Re: Reduce size of .json files
Posted:
1 Apr 25, 02:08
in response to: MarkusD
|
|
|
I would still be inclined to use sidecar files and modal windows for that kind of material. There would then be no need to "protect" the JSON files from it - the routine that generates those files would be unaware of its existence. And it wouldn't even appear in the HTML page code. There would be just a one-liner that launched a modal window and retrieved the content. The content wouldn't get loaded until the visitor wanted to see it. Much more efficient.
But you're using one of Laza's skins, and there's no API for the lightbox, so I wouldn't even know where to start. 
|
|
|
Posts:
789
Registered:
13-Apr-2006
|
|
|
|
Re: Reduce size of .json files
Posted:
1 Apr 25, 19:44
in response to: JeffTucker
|
|
|
|
Thank you Jeff for your thoughts.
I agree with you on almost all points. From a developer's point of view, these would all be very elegant measures. I wouldn't shy away from implementing such a solution with my very modest knowledge of web development. But there is one point about my current solution that is very practical. My code flows directly into the comment section of a folder. And this is deliberately intended and is my absolute preference. It's definitely not an emergency solution, it's a feature, not a bug.
One other thing is also important for me to mention. I mainly run this website for myself, everything should primarily work the way I want it to.
Cheers, Markus
|
|
|
Posts:
8,088
Registered:
31-Jan-2006
|
|
|
|
Re: Reduce size of .json files
Posted:
1 Apr 25, 23:26
in response to: MarkusD
|
|
|
I mainly run this website for myself....
Ah, there's your problem! That MarkusD user is a notorious, first-class prima donna. You need to start designing for the more discerning masses. 
|
|
|
|
Legend
|
|
Forum admins
|
|
Helpful Answer
|
|
Correct Answer
|
|