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

Uploading images is not possible #31

Open
jorgesat opened this issue Sep 28, 2022 · 15 comments
Open

Uploading images is not possible #31

jorgesat opened this issue Sep 28, 2022 · 15 comments

Comments

@jorgesat
Copy link

Describe the bug

An error message is shown when trying to upload any image (post, community icon, instance icon). The message is the following:

SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data

Context

  • Hardware: VPS bought online
  • YunoHost version: 11.0.9.14
  • I have access to my server: Through SSH | through the webadmin
  • Are you in a special context or did you perform some particular tweaking on your YunoHost instance?: no
  • Lemmy version: 0.16.7

Steps to reproduce

  • Install an instance.
  • Try to upload instance icon or banner, or try to upload an image to be posted.

Expected behavior

The instance should be able to accept image uploads.

Logs

Lemmy service log here: https://paste.yunohost.org/uhehososov

@yalh76
Copy link
Member

yalh76 commented Oct 19, 2022

That should be because pict-rs has been removed from lemmy_ynh as it was too difficult to maintain

@Xananax
Copy link

Xananax commented Nov 3, 2022

That's understandable, but is there a proposed mitigation? Can a user willing to take some risks install that module, for example? Is there a replacement? It seems to me like not having access to image uploads hampers the usefulness severely no?

Not being able to have icons also makes the installed lemmy instance feel unwelcoming.

edit: If anyone wants to explore installing this independently, the source is here: https://git.asonix.dog/asonix/pict-rs/

And it seems after installing, you'd have to edit lemmy-dev.hjson and add the line pictrs_url: "http://pictrs:8080" (or whatever else you're serving pictrs from).

I'm not entirely sure I understand all of it, but I'll try to make it work in the next few days.

@yalh76
Copy link
Member

yalh76 commented Nov 3, 2022

ok, let me know if it works, we could add informations into the readme

@Xananax
Copy link

Xananax commented Nov 3, 2022

Do you have the time to give me some context? What does "it caused too much issue during compilation" mean?

If not it's ok, I'll figure it out

@yalh76
Copy link
Member

yalh76 commented Nov 3, 2022

On 77c7db4#diff-6233345de4867c7ccf72bac1fc1067988d2a4c8e1ab9a746956eafccf88cfed2 , you can see what I've removed.

Before removing it last package_check was https://ci-apps.yunohost.org/ci/job/9054

Usually rust compilation failed on error: failed to get rust-s3 as a dependency of package pict-rs v0.3.0-rc.2

@Xananax
Copy link

Xananax commented Nov 12, 2022

Sorry, my VPS is too small, I had to remove some apps, of which Lemmy. I won't be pursuing this issue at the moment, unfortunately. I may later if I size up my instance.

From a very short preliminary research:

It seems like the issue is in the dependency chain. Possible mitigations:

  • delete ~/.cargo/registry/index directory and run cargo update again
  • deleteing Cargo.lock and running cargo update again
  • If using a weak dep ?, try locking a specific version

@retiolus
Copy link

Hi, any updates on this?

This makes the Lemmy installation on Yunohost partially unusable... I don't think it should be marked as a "High-quality app" on the catalogue until this problem is fixed.

@tobitobsengermanyone

This comment was marked as duplicate.

@tobitobsengermanyone

This comment was marked as off-topic.

@retiolus
Copy link

Hi, it's actually possible to "upload" images to Lemmy without pict-rs, publications can link to an external image, and the body can also use to do that. For avatars and banners, you can use Lemmy's API to specify external images as such.

https://join-lemmy.org/api/interfaces/SaveUserSettings.html#avatar

image

@tobitobsengermanyone
Copy link

tobitobsengermanyone commented Jun 19, 2023 via email

@tituspijean tituspijean mentioned this issue Jun 19, 2023
2 tasks
@tituspijean
Copy link
Member

I have started reimplementing Pict-RS, cf. PR mentioned above. It is still a work in progress, as uploads still fail. Contributions are welcome.

@tobitobsengermanyone
Copy link

tobitobsengermanyone commented Jun 20, 2023 via email

@DrMxrcy
Copy link

DrMxrcy commented Jul 6, 2023

I have started reimplementing Pict-RS, cf. PR mentioned above. It is still a work in progress, as uploads still fail. Contributions are welcome.

Thanks for working on this!

@D4llo
Copy link

D4llo commented Dec 6, 2023

Any update? I am not a rust developer but maybe I can help?

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

8 participants