Giter Club home page Giter Club logo

Comments (12)

natario1 avatar natario1 commented on May 18, 2024

So you just open app then set these dimensions?

from cameraview.

Monster-king avatar Monster-king commented on May 18, 2024

First i created my own app with your library, it has same issue. Then I clone your example, and it has same issue too.

from cameraview.

natario1 avatar natario1 commented on May 18, 2024

@Monster-king You didn't answer though :) please use the demo app, then describe clearly the steps to reproduce the bug, then post the logs you see in the logcat. The demo app will log a lot of useful things.

from cameraview.

Monster-king avatar Monster-king commented on May 18, 2024

@natario1 At the moment I've installed the app to my Samsung J1 2016 phone, changed the height to 480 (because in width is 480 too). When I pressed the update button I took the message "Height updated! Internal preview size: 640x480". Preview has black area like that screen. Here all logs.
new 2.txt

from cameraview.

natario1 avatar natario1 commented on May 18, 2024

@Monster-king thanks!
I just think the camera XML is wrong actually. Can you try modifying it?

If you open activity_main.xml you can see that CameraView is wrapped in a RelativeLayout. That makes no sense. Can you remove the relative layout and try again?

from cameraview.

Monster-king avatar Monster-king commented on May 18, 2024

@natario1 Relative layout removed, nothing changed.

from cameraview.

natario1 avatar natario1 commented on May 18, 2024

That's disappointing :) I don't know what's wrong right now, but CameraView looks to be measuring itself correctly. For the moment I guess you can just avoid to apply runtime changes to width / height. Or if you really need it, ensure you call requestLayout() on the view or on its parent.

If you have some time, you could do the following test:

  • add background="@color/red" to the RelativeLayout
  • add background="@color/green" to the CameraView
  • add to other views if you wish

Then tell me what colour you see in that area that is black now. Just to see what it belongs to. If it's red, then what if you remove the RelativeLayout?

from cameraview.

natario1 avatar natario1 commented on May 18, 2024

Nevermind, I was able to reproduce on another device. I will take a look myself

from cameraview.

natario1 avatar natario1 commented on May 18, 2024

So, this is a bug with low end devices that have isHardwareAccelerated() return false.

In that case CameraView will render in a SurfaceView (instead of TextureView) and we are not able to provide center crop behavior for surface views.

The current workaround for these devices is to use wrap content for both dimensions.

from cameraview.

Monster-king avatar Monster-king commented on May 18, 2024

I don't think so, because preview looks like compressed by height. Do you tested it in another device?

from cameraview.

natario1 avatar natario1 commented on May 18, 2024

@Monster-king can you try now? Demo app has changed and also a surface bug was fixed.

from cameraview.

Monster-king avatar Monster-king commented on May 18, 2024

@natario1 Fixed.

from cameraview.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.