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

photos with chinese characters don't upload as Main Image #547

Open
ebarry opened this issue May 27, 2016 · 6 comments
Open

photos with chinese characters don't upload as Main Image #547

ebarry opened this issue May 27, 2016 · 6 comments
Labels
bug the issue is regarding one of our programs which faces problems when a certain task is executed help wanted requires help by anyone willing to contribute testing issues are usually for adding unit tests, integration tests or any other tests for a feature

Comments

@ebarry
Copy link
Member

ebarry commented May 27, 2016

An image file with non-latin characters in the name uploaded as lead image on a research note failed to display. The note posts successfully, but the lead image is broken.

You could reproduce this issue by

  • saving this image and renaming it with its original name 图片17.jpg
  • posting a research note at publiclab.org/post with that as the lead image. NB: Posting requires a user account and being logged in, please create a user account at publiclab.org/signup.

17

What happened just before the problem occurred

Relevant URLs

https://publiclab.org/notes/Shizi/05-27-2016/kite-aerial-photography-in-china

PublicLab.org username

(to help reproduce the issue)

Browser, version, and operating system

For bug reports, fill out the above template; for feature requests, you can delete the template.

To learn how to write really great issues, which increases the chances they'll be resolved, see:

https://publiclab.org/wiki/developers#Contributing+for+non-coders

@jywarren jywarren added the bug the issue is regarding one of our programs which faces problems when a certain task is executed label May 27, 2016
@jywarren
Copy link
Member

Can you post the original name of the image, since it's since been replaced on the linked-to research note? Image uploading uses the paperclip gem, and the first step is probably to figure out whether the image:

  1. uploaded but does not display, or
  2. failed on upload and never got to display.

I think 1 is probably right, as I saw a "broken" image displayed when this note first published.

@ebarry ebarry added the help wanted requires help by anyone willing to contribute label May 31, 2016
@ananyo2012
Copy link
Member

Yes the image is being uploaded but the name is displayed incorrectly as you can see in this test research note https://publiclab.org/notes/ananyo2012/08-19-2016/testing-out-a-note-within-chinese-characters-in-main-image. This is weird as the same image shows up when you upload it in the body.

@ananyo2012
Copy link
Member

This is the ASCII format of the image name: %E5%9B%BE%E7%89%8717.jpg. if you paste this name beside the image path i.e. https://i.publiclab.org/system/images/photos/000/017/679/original/%E5%9B%BE%E7%89%8717.jpg you will be able to see the uploaded image. But somehow the name is displayed incorrectly in the note. The name of the image is fetched by @node.main_image.path(:original) as you can see in this line: https://github.com/publiclab/plots2/blob/master/app/views/notes/show.html.erb#L7

@ebarry
Copy link
Member Author

ebarry commented Nov 16, 2018

Hi all, just bumping this issue up as image upload -- if the title has non-latin characters -- to the Main Image, as well as Drag-n-Drop into the Body of a research note, is failing:
screen shot 2018-11-16 at 2 46 43 pm

@jywarren
Copy link
Member

jywarren commented Dec 4, 2018

I've created two tests -- a functional test and a test fixture -- which should fail, reproducing this error:

#4118

If this PR fails, we would love help resolving it. It might involve database encoding, as in #2665

@jywarren
Copy link
Member

I could use some help reproducing this error in a test! I haven't been able to, although it definitely happens on production. Any ideas?

@jywarren jywarren added the testing issues are usually for adding unit tests, integration tests or any other tests for a feature label Dec 10, 2018
@ebarry ebarry added this to the Internationalization milestone Nov 16, 2019
@stale stale bot added the stale label Oct 7, 2020
@publiclab publiclab deleted a comment from stale bot Oct 8, 2020
@stale stale bot removed the stale label Oct 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug the issue is regarding one of our programs which faces problems when a certain task is executed help wanted requires help by anyone willing to contribute testing issues are usually for adding unit tests, integration tests or any other tests for a feature
Projects
None yet
Development

No branches or pull requests

3 participants