Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to add images. #4

Open
nicxvan opened this issue Aug 20, 2019 · 9 comments
Open

How to add images. #4

nicxvan opened this issue Aug 20, 2019 · 9 comments

Comments

@nicxvan
Copy link

nicxvan commented Aug 20, 2019

I created this container and was able to get it running.

I grabbed the default password from the config and logged in.

I see a button called albums, but pressing it does nothing. I can't figure out how to add images or albums.

Console has these errors:

Failed to load resource: the server responded with a status of 500 (Internal Server Error)
api.js:87 LIST ERROR: (500) No Albums Processed

@jwater7
Copy link
Owner

jwater7 commented Aug 20, 2019

Sorry if it wasn’t clear from the description but this gallery only displays photos and videos that are already in an album, it currently does not have support to upload them, although I would welcome contributions to implement that.

Right now, an “album” is defined as the contents of a folder placed at the top level of the mounted images directory. The “collection” concept is based off of the date of the photo or video metadata (each month is a collection).

To display photos and videos in your case, create a directory in the location where you mounted the /images docker volume and drop your stuff into that subdirectory.

@nlighteneddesign
Copy link

Thanks!

@kklepper
Copy link

Well, I managed to log in with -e NO_AUTHENTICATION=yes and get no albums. Sure I have images in the right place:

/usr/src/app # ls -latr /images
total 21852
-rw-r--r--    1 root     root        322337 Dec 24 16:28 P1000527_2.JPG
-rw-r--r--    1 root     root        317110 Dec 24 16:28 P1000519.JPG
-rw-r--r--    1 root     root        312733 Dec 24 16:28 P1000518.JPG
-rw-r--r--    1 root     root        303106 Dec 24 16:28 P1000071.JPG
-rw-r--r--    1 root     root        315040 Dec 24 16:28 P1000044.JPG
-rw-r--r--    1 root     root        314310 Dec 24 16:28 P1000006.JPG
-rw-r--r--    1 root     root        323940 Dec 24 16:28 P1000598.JPG
etc.

What's wrong?

@jwater7
Copy link
Owner

jwater7 commented Dec 24, 2020

Hi @kklepper - I believe this is because the files are not in an album sub folder as described above. Please try something like:
mkdir /images/myalbum
mv /images/*.JPG /images/myalbum/

@kklepper
Copy link

Thanks for the quick reply.
My instruction was /gallery/ok:/images:ro and ok is populated. So I changed to /gallery:/images:ro

And it works! And it's fast!

I started with 2MB samples, then added 4 8MB samples. It takes a little to transfer the data, but then browsing is immediate. Excellent!

Next I used 16MB samples. Same here. Fullsize comes immediately, very nice, which explains that those pictures are really transferred fullsize, too, so your bandwidth will come into play. Very impressive to see the actual quality of the pictures at a mouse click.

But then the browser should cache the images, right? It doesn't so my theory must be wrong. It is roughly 5 secs for a 16MB photo of 6MB filesize, if I am correct. I am on a 100MBit/s line.

Also, sorting by date is fine, but subdirectories are not displayed. That makes it hard to keep order. I created directory Lumix and subdirectories for models like FZ1, FZ150, FZ62, but they are just presented by date. As there is no exif data, I am clueless. So I should drop Lumix and uplift the subdirectories one level. OK, that works.

Just discovered Fullscreen mode and Share. User credentials are in config.json, I found.

Automatic collections by date is a great idea. Would it be possible to add a label to describe what happened that day?

Responsive is a good name, except for the initial wait period. If the browser cache would work, it would be a one time issue. What about hundreds of pictures a day?

Also using ftp is fine, but you cannot pick candidates this way. Drag and Drop is what users want, right?

I implemented that technique in PHP for a contact form, so I know there should be ready to use libraries, no need to reinvent the wheel. But I'm sorry I am no expert in node and very short of time, too. This exploration is kind of a Christmas present.

@kklepper
Copy link

Oh, just found image information. How come size is 1.2MB when the file is 6,003KB?

4608 x 3456
1,2 MB

@kklepper
Copy link

As said, browser caching would help, but I think there is an easy solution to the wait period. Just show the first picture and then load the next in the background and so on. That should be possible with little effort, I guess.

Found Edit, too, but expected a rename. Favorite tagging should be realized in the menu bar upper right.

@kklepper
Copy link

Wanna hear more?

Thumbs is interesting, but poor. You can do better with imagemagick or graphicsmagick

yours:
image
PSP (but those tools are even better):
image

Now some are ok, looks like

  1. you show both 100x100 and 40x40 thumbs at 100x100
  2. the bigger the original the better the thumb

yours
image
PSP
image

Some if not all thumbs appear more than once (100/40 is clear, but why more?)

/api/v1/image?album=thumbs&image=FZ150/100x100/P1160257.JPG&thumb=100x100
/api/v1/image?album=thumbs&image=FZ150/40x40/P1160257.JPG&thumb=100x100
/api/v1/image?album=thumbs&image=Lumix/100x100/FZ150/P1160257.JPG&thumb=100x100
/api/v1/image?album=thumbs&image=Lumix/40x40/FZ150/P1160257.JPG&thumb=100x100

Ok, so I better remove the Lumix folder manually.

Clicking on a thumb should show the original, of course, not the thumb.

auth should not be listed as album.

@jwater7
Copy link
Owner

jwater7 commented Dec 25, 2020

@kklepper - Thanks for the thoughtful comments. Since this is just a side project I don't have a lot of time to devote to it, but I'd love to see a lot of your suggestions realized and have thought to someday be able to include them in the project (small/incremental contributions are always welcomed):

  • Support for optional subdirectory album organization
  • Add text descriptions to images and/or albums
  • Configurable thumbnail quality/size
  • Favorite tagging moved to a better location (currently it's really just a rough draft to get backend functionality in place). Also support of other text tags
  • Renaming, uploading, etc - all the editor functions would be nice eventually

Just a couple comments on your experience:

  • Image caching is going to be a setting and determined by the browser, I expect there will be a limit to how much your browser will likely cache (for example, once it hits a couple gigabytes you'll probably want start purging old cache
  • Emphasis for this project is placed on speed to render so thumbnail quality for the "preview" pages is limited by that tradeoff

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants