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

Image confusion: wants JPG, then complains over size #1153

Closed
kseistrup opened this issue Sep 30, 2022 · 2 comments
Closed

Image confusion: wants JPG, then complains over size #1153

kseistrup opened this issue Sep 30, 2022 · 2 comments

Comments

@kseistrup
Copy link

This was confusing:

> /image #mygroup image.jpg
image type must be JPG, send as a file using /f
> /image #mygroup image.JPG
max image size: 236700 bytes, resize it or send as a file using /f

I can't believe that SimpleX requires a literal .JPG extension in uppercase, so I decide to peek in the source — even if I don't speak Haskell (commit 07d2c9f):

$ cat -n Simplex/Chat/View.hs | rg '92[67]'
   926	    CEFileImageType _ -> ["max image size: " <> sShow maxImageSize <> " bytes, resize it or send as a file using " <> highlight' "/f"]
   927	    CEFileImageSize _ -> ["image type must be JPG, send as a file using " <> highlight' "/f"]

It looks as if the two error messages have been swapped, doesn't it? At least that would explain the error messages with the image.{jpg,JPG} image (which was the same image, just renamed to please SimpleX):

  1. Given a too big image.jpg it mistakenly complains about the filetype.
  2. User is confused because the image is a JPEG and renames the file to image.JPG in order to comply.
  3. SimpleX doesn't like the .JPG extension, but is told to complain over the size.

Indeed. Let's try with the logo.svg from the SimpleX repo. It's an SVG file of size 4386 bytes:

> /image #mygroup logo.svg
max image size: 236700 bytes, resize it or send as a file using /f

Boom! 💣

@spaced4ndy
Copy link
Contributor

Yeah, this is definitely an error.. 🤦‍♂️ Guess we're mostly using /f command for files when in terminal and somehow this slipped by. Thanks!

@epoberezkin
Copy link
Member

I do use /imgf a lot with the images I receive in the terminal with mobile clients, I almost never use /img...

This one is easy to fix.

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

3 participants