CaramelFur / Picsur

An easy to use, selfhostable image sharing service like Imgur with built in converting
https://picsur.org/
GNU Affero General Public License v3.0
774 stars 41 forks source link

Thumbnails are not correct #84

Open aldumil opened 4 months ago

aldumil commented 4 months ago

The displayed thumbnails for images are not correct and they change everytime the page is refreshed, occasionally all the thumbnails will the same image. The names are correct, and if I open the image page it's fine. Not really sure how to diagnose the issue, no errors anywhere as far as I can tell.

cwinl commented 3 months ago

The same to me . I'm confused for a few seconds. want to konw how to fix it.

mptpro commented 3 months ago

Same here. TBH, I don't think there's a lot of development happening with this project.

chrgeorgeson commented 3 months ago

It's a shame I, too, run into this problem.

I like Picsur and have set up some great integrations. I frequently take screenshots on my desktop/laptop/phone and have set up automation to upload all my screenshots to Picsur with a 2-week expiration. However, it's hard to go through them all and find prior screenshots that all look like the same image on the thumbnail. I might need to find something else but I really don't want to.

RayBomb87 commented 3 months ago

same here, its really hard to find the correct picture when the pic name is generic and the preview is wrong/changes on every refresh

mptpro commented 3 months ago

It's a shame I, too, run into this problem.

I like Picsur and have set up some great integrations. I frequently take screenshots on my desktop/laptop/phone and have set up automation to upload all my screenshots to Picsur with a 2-week expiration. However, it's hard to go through them all and find prior screenshots that all look like the same image on the thumbnail. I might need to find something else but I really don't want to.

Can I ask you how you set-up the automation to upload a photos in a particular folder to Picsur? Thanks!

chrgeorgeson commented 3 months ago

Can I ask you how you set-up the automation to upload a photos in a particular folder to Picsur? Thanks!

Sure! I primarily use Windows on both my desktop and laptop, though a similar approach could be applied on Linux or Mac.I've set up a PowerShell script that monitors a specific folder, and I run this script as a service using NSSM (Non-Sucking Service Manager) to simplify the process.

For taking screenshots, I use Greenshot, and I configure it to automatically save all files to a designated directory. When a new image is detected in this directory, the PowerShell script uploads it to Picsur via an API call, setting a 2-week expiration for the image.

Additionally, on my Android phone, I use Tasker to monitor my screenshots directory. Whenever a new screenshot is captured, Tasker uploads it to a Google Drive folder.

These files are then synced to my computer, where another service managed by NSSM performs a similar upload task for my Android screenshots.

This ensures that all my screenshots are automatically backed up to Picsur, regardless of the device I'm using.

I just set it up with ZipLine as an alternative to Picsur but I would prefer to stay with Picsur. I also tried reaching out to the developer via email and so far no response. Tis the way sometimes 🤣

mptpro commented 3 months ago

Thank you @chrgeorgeson !

If you have the time, can you explain this step a little, or point me in the right direction?

the PowerShell script uploads it to Picsur via an API call, setting a 2-week expiration for the image.

chrgeorgeson commented 3 months ago

Thank you @chrgeorgeson !

If you have the time, can you explain this step a little, or point me in the right direction?

the PowerShell script uploads it to Picsur via an API call, setting a 2-week expiration for the image.

The upload process you're setting up involves two main API calls:

Uploading the image - This initial step uploads the image to the server. Updating the image - After uploading, you'll need to update the image to set its expiration date.

Here's a basic outline of the API endpoints you'll be working with:

You will need to manage bearer tokens for authentication.

The process involves uploading each image and then capturing the unique ID (UID) of the uploaded image. This UID is crucial as it's required to set the expiration date for the image.

Here’s a quick rundown of how it’s done:

You can find detailed examples of how to handle these requests in your preferred programming language at the following Postman documentation links:

Upload Image API Update Image API

Lastly, while I prefer using Greenshot for its features and flexibility, it’s worth noting that ShareX also integrates natively with Picsur and theoretically would simplify and possibly eliminate some of the steps you're manually handling with PowerShell scripts. It could be a worthwhile alternative to consider.

mptpro commented 3 months ago

@chrgeorgeson thank you very much!

mptpro commented 3 months ago

@chrgeorgeson Last question, I promise.

I writing a bash script (in Linux) and I'm not sure where/how I tell it my API key? If I run it as below I get a permission error (obviouisly).

curl --location 'http://192.168.86.23:7480/api/image/upload' --form 'image=@"/home/mpt/a.png"'