Multiple images per package are now supported

I added some rudimentary support for multiple images per package. You can see more than one screenshot at czg07.

To submit more images, just add them to the packages SHA256 directory with reasonable filenames and make a pull request. Any resolution is ok. PNG is preferred. For example images for czg07 are in https://github.com/Quaddicted/quaddicted-images/tree/main/by-sha256/38/38ee9811a6181f4b302ded52f1eade9fa131b2f7e0de801615aa9234beb39257

Every package's page now has a "Add images" link that takes you right to the correct directory on GitHub:

If someone is CSS-smart, it would be ace to have some rules that squeeze all images that are inside a fixed size div into a smart and sexy grid. I was too stupid and used some flexbox with precalculated image widths based on the number of images. It would be ace if it could be done client-side in the browser (without JavaScript!).

2 Likes

Clicking on an image to view it in a larger size causes it to be downloaded instead. Can You fix it, please, Spirit? Thank You!

It works fine for me, are you sure it is a server-side issue and not your browser?

It is weird of course, but I'm encountered the same issue at two PCs and all browsers I have: Firefox, Edge, Opera.

O! It happened only on last added to DB pages! I just checked this.

@Spirit See my post here : Misconfigured content-type on web server?

Depends on file type (JPEG vs JPG ).

All the same pages for me. And this too

Thank you, I fixed it!

2 Likes

Until screenshots are included in the API it might be best to make sure there's always one screenshot named <filename>.jpg
For example colony5.jpg in here would make sure API clients (QuakeInjector, QuaddictedTool) can still show a screenshot. What do you think?

1 Like

Yes, it would be a good idea to do that.

Yes that would be super useful! But:

Sadly filenames aren't unique per file so it would need to be the hash or something generic. For a generic name, it would need to fit any kind of package. image.jpg? main.jpg?

I don't want to force a file format (JPEG/PNG/WEBP/...) but allow lots of freedom for the users, at least in the https://github.com/Quaddicted/quaddicted-images repo. For quaddicted.com there is an imageproxy between the repo and the frontend, that converts the source files to JPEG at the moment.

I think it would be better to add an optional section to the API responses with the "Quaddicted" data, i.e. aggregate ratings, comments and images. Maybe in a new top-level key like this:

"quaddicted": {
 "rating": {
  "average": 123,
  "median": 123,
  "count": 123
 },
 "images": [
  "foo.ext",
  "bar.ext",
 ],
 "comments": {...}
}

API requests could somehow ask for these to be included with query parameters. I need to check if I can easily plug this into the SOLR wrapper I build or if it would be better to integrate this data directly in the SOLR data itself.

Thoughts? I am not sure his soon I can build this, time is even more rare than usual at the moment.

Sadly filenames aren't unique

That's not a problem, though, or am I missing something? The URL still would be unique because it already contains the hash:
https://www.quaddicted.com/files/quaddicted-images/by-sha256/e0/e026f897b485da7a5f1e3c145f1bfe1be3538bb6bbdb31c2d1342e14b40899e9/colony5.jpg