Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Should I stay with G2 or should I go back?
Started by joe528 Nov 26 2013 11:19 PM

16 replies to this topic
[TOPIC CONTROLS]
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

joe528

[GLOBAL: userInfoPane.html]
joe528
  • Contributor

  • 800 posts
  • Corona SDK

I have migrated my app to use G2, but the users have been reporting errors in the pictures my app is showing.

For example, the images would suddenly become unreadable. This has never occurred in G1 before and I even don't know the procedure to reproduce it. This weird bug just happens from nowhere sometimes. The other is that the images are all gone once users press Home key and come back in (Android device) for certain scene.

Some users even specifically ask if any older version is available because they don't want to use my new version.

Should I go back to use G1 or Corona actually knows what's happening and things will be fixed soon?

[TOPIC: post.html]
#2

jonjonsson

[GLOBAL: userInfoPane.html]
jonjonsson
  • Corona Geek

  • 1,051 posts
  • Corona SDK

You probably need Corona response, but Its not very clear what the problem is. Images become unreadable? Images from where? What do you mean by unreadable?



[TOPIC: post.html]
#3

joe528

[GLOBAL: userInfoPane.html]
joe528
  • Contributor

  • 800 posts
  • Corona SDK

I downloaded images from the internet and use display.newImage to display them. Unreadable means the images would become distorted. The image is still placed at the right position and with the correct width/height except that the content is distorted, unrecognizable,filled with different colors.

[TOPIC: post.html]
#4

ingemar

[GLOBAL: userInfoPane.html]
ingemar
  • Corona Geek

  • 2,733 posts
  • Enterprise

I've seen that mentioned on some other threads. That images would sometimes appear corrupt/skewed in G2.
Sorry, but I don't recall any thread titles.

[TOPIC: post.html]
#5

ingemar

[GLOBAL: userInfoPane.html]
ingemar
  • Corona Geek

  • 2,733 posts
  • Enterprise

If you have an app in production, I'd recommend to revert until the issue is solved.

[TOPIC: post.html]
#6

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,241 posts
  • Enterprise

We want to address any issues, but if I'm being honest, we need more information, like a sample project that shows the problem, a list of devices its failing on, a screen shot of the bad behavior.  This needs to be submitted to the bug tracking process using the Report a Bug link at the top of the page.   Without this information we stand almost no chance of solving the problem.

 

Thanks

Rob



[TOPIC: post.html]
#7

editor

[GLOBAL: userInfoPane.html]
editor
  • Contributor

  • 101 posts
  • Corona SDK

Hi Guys,

 

I'm also having problems.  I'm using version 1 compatability with the config file change.

 

I've got a basic sports game with a one pixel diameter circle for a ball moving across the screen.

 

The problem for me is that when the ball moves it looks all blurry, or jerky or something.  Haven't tried it on a device, only the simulator, but it looks really bad, and it's such a simple and small animation.

 

Is this something to do with using version 1 compatibility?

 

 

thanks

 

Daniel



[TOPIC: post.html]
#8

jonjonsson

[GLOBAL: userInfoPane.html]
jonjonsson
  • Corona Geek

  • 1,051 posts
  • Corona SDK

Daniel, I think this is called thread hijacking of the highest of degree :) Anyway, you say its simple, so post a runable sample and we can probably figure it out quickly.



[TOPIC: post.html]
#9

joe528

[GLOBAL: userInfoPane.html]
joe528
  • Contributor

  • 800 posts
  • Corona SDK

@Rob I can understand to be more specific and file bug reports. But the problem is that I don't know the exact steps to reproduce some of the bugs. 

 

Especially for the bug that the images might get corrupt/skewed, it seems very random & it looks like a very fundamental bug. That's why I would ask if Corona is aware of these kind of things first. 

 

If not, probably I need to go back to G1 before the bugs in G2 converge more. (I didn't realize G2 was actually in such an unstable phase).



[TOPIC: post.html]
#10

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,241 posts
  • Enterprise

Can we at least get a screen shot and what your program is doing at the time?   Can we get a list of devices that's generating the issues?



[TOPIC: post.html]
#11

editor

[GLOBAL: userInfoPane.html]
editor
  • Contributor

  • 101 posts
  • Corona SDK

Hi Jon,

 

I've got a pretty powerful computer not doing anything so pretty sure it's not that.

 

However, I've just downloaded the SDK release that uses Graphics 1 and it's pretty much the same.  So the problem would appear to be elsewhere, and sorry for the incorrect post.

 

regards



[TOPIC: post.html]
#12

joe528

[GLOBAL: userInfoPane.html]
joe528
  • Contributor

  • 800 posts
  • Corona SDK

About the image skewed bug, now I figured out how to reproduce it. It only happens for resized image (Jon, this is the function you showed me earlier, probably your problem is related to this too?)

 

So if an image is resized by this function

local function picResizeCrop(photo, endWidth, endHeight)
    
    local tempGroup = display.newGroup()
    
    local tmpBg = display.newRect(leftX, topY, trueW, trueH)  
    tmpBg.anchorX = 0
    tmpBg.anchorY = 0
    tmpBg.x = leftX
    tmpBg.y = topY
    tmpBg:setFillColor(1, 1, 1)
    tempGroup:insert(tmpBg)
    
    photo.x = display.contentCenterX
    photo.y = display.contentCenterY
    tempGroup:insert(photo)
    
    -- Find the bigger scale out of widht or height so it will fill in the crop
    local scale = math.max(endWidth / photo.width, endHeight / photo.height)
    
    photo:scale(scale, scale)
    
    -- This object will be used as screen capture boundaries object
    local cropArea = display.newRect(display.contentCenterX, display.contentCenterY, endWidth, endHeight)
    cropArea.x     = display.contentCenterX
    cropArea.y     = display.contentCenterY
    cropArea.alpha = 0.0
    tempGroup:insert(cropArea)
    
    -- Now capture the crop area which the user image will be underneith
    local myCaptureImage = display.captureBounds(cropArea.contentBounds)

    display.getCurrentStage():insert(photo)
    tempGroup:removeSelf()
    tempGroup = nil
 
    return myCaptureImage
end

 

The images show correctly after calling this function but if I press HOME key and re-enter the app again, the images are corrupted.

 

I have filed a bug report, #28502.  Hope this can gets fixed soon or it's utterly weird for users to experience this.

 

Thanks.



[TOPIC: post.html]
#13

jonjonsson

[GLOBAL: userInfoPane.html]
jonjonsson
  • Corona Geek

  • 1,051 posts
  • Corona SDK

I'm not sure what problem of mine you are referring to. I have seen the skewed bug in mac simulator though, take picture and apply that function. However if I choose pic from library and apply function, it is not skewed.



[TOPIC: post.html]
#14

joe528

[GLOBAL: userInfoPane.html]
joe528
  • Contributor

  • 800 posts
  • Corona SDK

images rendered by display.captureBounds() have some problem. Try this code in an Android device with any jpeg image (rename it to "test.jpeg")

 

    local img = display.newImage("test.jpeg", 0, 0)
    
    local scale = math.max(200 / img.width, 200 / img.height)
    img:scale(scale, scale)
    
    img.anchorX = 0.5
    img.anchorY = 0.5
    img.x = display.contentWidth * 0.5
    img.y = display.contentHeight * 0.5
    
    local screenBounds =
    {
        xMin = (display.contentWidth-200)*0.5,
        xMax = (display.contentWidth+200)*0.5,
        yMin = (display.contentHeight-200)*0.5,
        yMax = (display.contentHeight+200)*0.5,
    }

    local newPic = display.captureBounds(screenBounds)
    
    img:removeSelf()
    img = nil
    
    newPic.y= display.contentWidth * 0.5
    newPic.x= display.contentWidth * 0.5

 

The image shows without problem. Now press Home key and re-launch the app again, you will see the image either disappears or is skewed. (One user told me the images are skewed even without pressing Home & re-entering for his Android device, which worries me most)

 

My app uses a lot of images generated by display.captureBounds() and this bug might be related to other fundamental problems in G2. I really hope this bug can be addressed as soon as possible. It's too late for me to revert back to G1 (I didn't tag my source code because I didn't expect I would need to revert back), I have to wait for the fix. 

 

Please, I have spent last few days debugging Corona. :wacko: And a bug like this is holding off my progress.



[TOPIC: post.html]
#15

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,241 posts
  • Enterprise

It sounds like you are a reproducible test case.  Would you mind filling out a bug report using the "Report a bug" feature at the top of the page, so this gets into engineering's work queue?  Please post the bug report number back here for reference.

 

Thanks

Rob



[TOPIC: post.html]
#16

joe528

[GLOBAL: userInfoPane.html]
joe528
  • Contributor

  • 800 posts
  • Corona SDK

Yes I have filed and mentioned in my earlier post.

 

The bug number is #28502.

 

I am pretty sure it's all caused by display.captureBound(). I also played with display.capture(), it has the same problem.



[TOPIC: post.html]
#17

joe528

[GLOBAL: userInfoPane.html]
joe528
  • Contributor

  • 800 posts
  • Corona SDK

This issue is answered in another thread 

 

http://forums.coronalabs.com/topic/40894-fixed-screencapture-and-screencapturebounds/

 

Looks like display.captureBound() works this way. You can't suspend the app and re-enter to expect the rendered image intact (especially for Android devices)

 

I think this should be added to the API document. I wouldn't use display.captureBound() if I knew this in the first place. In what case this function can be used if suspending the app is going to mess up the images?




[topic_controls]
[/topic_controls]