Gallery app shows pictures abnormally if target directory or file name contained Chinese text .

Bug #1319698 reported by Gabriel Zhi Chen
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OEM Priority Project
Fix Released
High
Unassigned
Trusty
Fix Released
High
Jussi Pakkanen
Thumbnailer
Fix Released
High
Jussi Pakkanen
gallery-app
Fix Released
High
Arthur Mello
thumbnailer (Ubuntu)
Fix Released
High
Jussi Pakkanen
Trusty
Fix Released
Undecided
Jussi Pakkanen

Bug Description

Steps:
1. Copy some pictures to ~/Pictures
2. Launch Gallery app by entering "gallery" in Dash
3. Observe what the Gallery shows.

Actual results:
There are some transparent frames in Gallery.

Expected results:
Gallery app should show pictures included in ~/Pictures directory in step 2.

Platform:
Lenovo S440s

Note:
Once Gallery's target directory or file name of the target directory contains Chinese text, the issue will be reproduced. Adverse, if Gallery's target directory or file name of the target directory in English, Gallery displays normally.

Related branches

Revision history for this message
Gabriel Zhi Chen (gabrielzchen) wrote :
Revision history for this message
Yu Ning (yuningdodo) wrote :

For anyone who wants to reproduce this issue with an English installation, please put some pictures in you ~/Pictures/ directory, rename one of them to 图片.jpeg (you should keep your file extension), and launch gallery-app to check it.

Ara Pulido (ara)
Changed in oem-priority:
importance: Undecided → High
Bill Filler (bfiller)
Changed in gallery-app:
importance: Undecided → High
assignee: nobody → Arthur Mello (artmello)
status: New → Triaged
importance: High → Critical
tags: added: rtm14
Bill Filler (bfiller)
Changed in thumbnailer:
assignee: nobody → Jussi Pakkanen (jpakkane)
importance: Undecided → Critical
Revision history for this message
Arthur Mello (artmello) wrote :

Gallery seems to handle the pictures with chinese text. We can see the entries for each one on the "Photos" tab. If we click on one of them the correct picture is open. The problem seens to be on the picture thumbnail that is not displayed. We are using libthumbnailer for that and we can see the following error message:
"Failed to get image from provider: image://thumbnailer//home/arthur/Pictures/图片.JPG"

We need to check how libthumbnailer handles filenames with chinese text.

Revision history for this message
Jussi Pakkanen (jpakkane) wrote :

Thumbnailer is not even aware of the existance of text encodings. It deals only with strings. My hunch is that the original filename is not in (normalised) utf-8 and somewhere a conversion from filename to unicode string and back to filename mangles the string.

Revision history for this message
Jussi Pakkanen (jpakkane) wrote :

Note that QString stores things in utf-16 (or was it ucs-16 or something else) so there is lots of potential for name mangling.

Revision history for this message
Arthur Mello (artmello) wrote :

I added an unit test to thumbnailer. Just added a sample picture file with chinese_text on the name on a test dir, iterated over all files on dir and called get_thumbnail passing the file path. The behavior is the same that we have on gallery, the thumbnail is not created on cache dir for the sample picture. The test uses string and array of char to pass the path to the function.

Jussi, could you check if it is really a problem with thumbnailer or if I misinterpretated some part of the process?

Here is the branch I pushed lp:~artmello/thumbnailer/thumbnailer-chinese_text_name

Revision history for this message
Jussi Pakkanen (jpakkane) wrote :

There is an unicode encoding bug, but it is in a very sneaky place. Thumbnailer needs to write the original location inside PNG metadata using ISO-8859-1 encoding. Working on a fix.

Revision history for this message
Arthur Mello (artmello) wrote :

Just tested gallery using thumbnailer from the branch that Jussi pushed and the issue described by Yu Ning does not happen anymore.

Changed in gallery-app:
status: Triaged → In Progress
Changed in thumbnailer:
status: New → In Progress
Changed in oem-priority:
status: New → In Progress
tags: added: touch-cn
Bill Filler (bfiller)
Changed in thumbnailer (Ubuntu):
status: New → In Progress
importance: Undecided → Critical
assignee: nobody → Jussi Pakkanen (jpakkane)
Revision history for this message
Rick Spencer (rick-rickspencer3) wrote :

This bug needs to be fixed in time for a Chinese launch, but is not critical for our first partner launch. Changing importance to High.

Changed in thumbnailer:
importance: Critical → High
Changed in gallery-app:
importance: Critical → High
Revision history for this message
Pat McGowan (pat-mcgowan) wrote :

fix after rtm

Changed in thumbnailer (Ubuntu):
importance: Critical → High
importance: High → Critical
Changed in thumbnailer (Ubuntu):
importance: Critical → High
Revision history for this message
Ara Pulido (ara) wrote :

We are already shipping gallery-app in our pre-installed Ubuntu Desktop systems, so we would need a fix for this sooner, rather than later.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package thumbnailer - 1.1+14.10.20140811-0ubuntu1

---------------
thumbnailer (1.1+14.10.20140811-0ubuntu1) utopic; urgency=low

  [ Ubuntu daily release ]
  * debian/libthumbnailer0.symbols: auto-update to released version

  [ Arthur Mello ]
  * Work with file names with non-european characters by not writing
    metadata chunks when they can't be represented in ISO-8859-1. (LP:
    #1319698)

  [ Jussi Pakkanen ]
  * Work with file names with non-european characters by not writing
    metadata chunks when they can't be represented in ISO-8859-1. (LP:
    #1319698)

  [ Pawel Stolowski ]
  * Request images of size 400 instead of 200 from ubuntu server.
 -- Ubuntu daily release <email address hidden> Mon, 11 Aug 2014 14:20:34 +0000

Changed in thumbnailer (Ubuntu):
status: In Progress → Fix Released
Arthur Mello (artmello)
Changed in oem-priority:
status: In Progress → Fix Released
Changed in thumbnailer:
status: In Progress → Fix Released
Changed in gallery-app:
status: In Progress → Fix Released
Revision history for this message
Bin Li (binli) wrote :

@Arthur,

 From Ara says we need it for our pre-installed Ubuntu Desktop, and we use the trusty, do we prepare to fix it for trusty? Thanks!

Revision history for this message
Arthur Mello (artmello) wrote :

@binli, there is no change on the gallery-app code for this bug. We should check with @jpakkane if we could have the relevant fix on the thumbnailer trusty branch.

Revision history for this message
Bin Li (binli) wrote :

@Arthur,

 Yes, thanks for your feedback.

@jpakkane, @Jussi

 Do we prepare to fix it for trusty? Thanks!

Revision history for this message
Bin Li (binli) wrote :

@Jussi,

 Could you help to put it into trusty? Thanks!

Changed in oem-priority:
status: Fix Released → New
Ara Pulido (ara)
Changed in thumbnailer (Ubuntu Trusty):
assignee: nobody → Jussi Pakkanen (jpakkane)
Revision history for this message
Jussi Pakkanen (jpakkane) wrote :

I will get this done tomorrow.

Revision history for this message
Bin Li (binli) wrote :

@Jussi,

 Cool!!!

Changed in thumbnailer (Ubuntu Trusty):
status: New → In Progress
Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Gabriel, or anyone else affected,

Accepted thumbnailer into trusty-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/thumbnailer/1.1+14.04.20150205-0ubuntu1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in thumbnailer (Ubuntu Trusty):
status: In Progress → Fix Committed
tags: added: verification-needed
Revision history for this message
Jussi Pakkanen (jpakkane) wrote :

Tested version 1.1+14.04.20150205-0ubuntu1 on trusty desktop and this bug has been fixed.

tags: added: verification-done
removed: verification-needed
Revision history for this message
Bin Li (binli) wrote :

After test the new 1.1+14.04.20150205-0ubuntu1 libthumbnailer0 in trusty-proposed, it works fine.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package thumbnailer - 1.1+14.04.20150205-0ubuntu1

---------------
thumbnailer (1.1+14.04.20150205-0ubuntu1) trusty; urgency=medium

  [ Jussi Pakkanen ]
  * SRU backport of patch to make file names with chinese characters
    work. (LP: #1319698)
 -- Ubuntu daily release <email address hidden> Thu, 05 Feb 2015 12:10:33 +0000

Changed in thumbnailer (Ubuntu Trusty):
status: Fix Committed → Fix Released
Revision history for this message
Adam Conrad (adconrad) wrote : Update Released

The verification of the Stable Release Update for thumbnailer has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Ara Pulido (ara)
Changed in oem-priority:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers