Closed Bug 944848 Opened 11 years ago Closed 6 years ago

[B2G][Helix][Gallery][zhaodawei]After being edited and saved, the preview.width/preview.height of the new image were not same with the old image.

Categories

(Firefox OS Graveyard :: Gaia::Gallery, defect, P2)

defect

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: lecky.wanglei, Unassigned, NeedInfo)

Details

Attachments

(1 file)

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E; aff-kingsoft-ciba; Zune 4.7)

Steps to reproduce:

1/Launch the gallery APP.
2/Choose one photo and edit it.
3/Save the editing content.
4/Preview the new saved image.


Actual results:

Firstly the new image was showed parts and then all the content.


Expected results:

It should be showed as same as the old one.
After tracking the debug log,I find as follow:

11-30 06:22:35.730: ERROR/GeckoConsole(2510): Content JS ERROR at app://gallery.gaiamobile.org/js/frame_scripts.js:1471 in displayImage: The thumbnail contained in the jpeg doesn't fitthe device screen. The full size image is rendered.This might cause out of memory errors

Add further log to the codes and find as follow:
1/Preview the original photo
11-30 06:35:21.059: INFO/GeckoDump(622): Gallery_DBG  preview.width:480 preview.height:640 screenWidth:480 screenHeight:799.5
11-30 06:35:21.069: INFO/GeckoDump(622): Gallery_DBG  preview.width:480 preview.height:640 screenWidth:480 screenHeight:799.5
11-30 06:35:21.079: INFO/GeckoDump(622): Gallery_DBG  preview.width:480 preview.height:640 screenWidth:480 screenHeight:799.5

2/After editing,preview the original photo
11-30 06:34:09.849: INFO/GeckoDump(622): Gallery_DBG  preview.width:320 preview.height:426.6666666666667 screenWidth:480 screenHeight:799.5
11-30 06:34:09.879: INFO/GeckoDump(622): Gallery_DBG  preview.width:480 preview.height:640 screenWidth:480 screenHeight:799.5
11-30 06:34:09.889: INFO/GeckoDump(622): Gallery_DBG  preview.width:480 preview.height:640 screenWidth:480 screenHeight:799.5

3/Preview the new photo which was saved
11-30 06:38:48.539: INFO/GeckoDump(715): Gallery_DBG  preview.width:320 preview.height:426.6666666666667 screenWidth:480 screenHeight:799.5
11-30 06:38:48.549: INFO/GeckoDump(715): Gallery_DBG  preview.width:320 preview.height:426.6666666666667 screenWidth:480 screenHeight:799.5
11-30 06:38:48.559: INFO/GeckoDump(715): Gallery_DBG  preview.width:480 preview.height:640 screenWidth:480 screenHeight:799.5

You can see that the preview.width/preview.height were changed after editing the original photo.
So when previewing the new photo,it goes another display branch.

Please help to check how to fix it.

And in the codes,I find another doubt.
In function |showFile| from file |/gaia/apps/gallery/js/frames.js|,I find tree calls:
  setupFrameContent(n - 1, previousFrame);
  setupFrameContent(n, currentFrame);
  setupFrameContent(n + 1, nextFrame);
I don't know why should setup frame content for previous/current/next frame at one time.
blocking-b2g: --- → hd?
Priority: -- → P2
Flags: needinfo?(wchang)
Not blocking based on the description.

Evelyn, can someone check this and see if there is more impact than described?

Thanks
blocking-b2g: hd? → ---
Flags: needinfo?(wchang) → needinfo?(ehung)
The description confuses me. If you edited an image and saved, why you expect to see the old one?
Flags: needinfo?(ehung)
Flags: needinfo?(lecky.wanglei)
okay, so now I figured out you are talking the width and height should be the same.
Luke, can you take a look of this?
Flags: needinfo?(lecky.wanglei) → needinfo?(lchang)
I've checked that the call flows of saving files after we get the blob data from camera and gallery are totally the same in Gaia. That means the only difference between these two cases is where we get the blob data.

To my knowledge, the jpeg blob data we get from "mozCameras" is compressed by the camera module in bottom layer. On the other hand, the data from "canvas.toBlob" which we use to get the modified image in gallery app is compressed by the jpeg library in Gecko. There is a reasonable chance that we get different size of image files if the jpeg compressing parameters in these two libraries are inconsistent.

However, I think this bug is not blocking indeed since there is no risk here.
Flags: needinfo?(lchang)
There is another problem which caused by this reason.
1.Edit one picture and save it.
2.Choose another picture to preview.
3.Slide from left to right to find the picture you edited just now.
4.Rotate the phone 90 degrees.
5.Image display abnormal.
Please see the attached screenshot.

So I think this bug will case some unkown displaying problem.
Attached image screenshot.png
Flags: needinfo?(lchang)
Clear ni? at this bug and please file another bug for the issue mentioned in comment 6 if needed.
Flags: needinfo?(lchang)
It is not clear what the issue is? Are you saying that image that was just edited is not displayed correctly when you rotate the phone? There is mention of height/width issues - so not clear

Can you please clarify the issue please?
Flags: needinfo?(lecky.wanglei)
Firefox OS is not being worked on
Status: UNCONFIRMED → RESOLVED
Closed: 6 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: