skykai521 / stickercamera Goto Github PK
View Code? Open in Web Editor NEWThis is an Android application with camera,picture cropping,collage sticking and tagging.贴纸标签相机,功能:拍照,相片裁剪,给图片贴贴纸,打标签。
This is an Android application with camera,picture cropping,collage sticking and tagging.贴纸标签相机,功能:拍照,相片裁剪,给图片贴贴纸,打标签。
本来想借鉴一下,但是下下来之后,发现没法跑。
直接检出你这个项目后,运行报When running gradle with java 6 or 7, you must set the path to jdk8, either with property retrolambda.jdk or environment variable JAVA8_HOME 这个错误
话说,也并不一定需要retrolambda这个插件吧,还是先去掉吧
Dear StickerCamera Developers,
I am implementing a hang-bug detection tool and I am analyzing StickerCamera (master version downloaded today) with it. I found that the main thread of StickerCamera, frequently calls:
com.stickercamera.app.camera.ui.CameraActivity$SurfaceCallback.surfaceCreated
at line 422 which correspond to:
android.hardware.Camera.open
and frequently calls:
com.stickercamera.app.camera.ui.CameraActivity.initCamera
at code line 492, which correspond to
android.hardware.Camera.startPreview.
In my experiments, the execution of those functions on the main thread may be the main cause of the eye-detectable delays (i.e., hang-bug) experienced with StickerCamera while taking pictures.
Moving work off the main thread leads to higher responsiveness of the app.The android development guide in the explanation of the "android.hardware.Camera.open" method, suggests indeed "Caution: On some devices, this method may take a long time to complete. It is best to call this method from a worker thread (possibly using AsyncTask) to avoid blocking the main application UI thread." Also, startPreview could probably be moved off the main thread to improve responsiveness of the app.
Do you think that it is possible to move off the main thread those functions to improve responsiveness?
Did you know about these two problems with your code?
Thanks for any information,
I hope I can help improve StickerCamera.
有神马梗,可否修复一下。能运行。。。。
hello
how can i share my created image by this program?
thanks
大家有同感吗?
目前有五种监听 ,焦点改变,贴纸down事件,贴纸move事件,贴纸点击事件,还有标签点击事件,请问如何添加进标签长按事件的监听呢
这个要是有IOS版就好了,有没有对ios感兴趣的。
Hello,
I want to add .Gif images instead of .png images & generate video output,
I have success fully load .gif images in ur project, i dont know how to make video with background image & overlay image.
for that did u have any idea how to do that?
Thanks.
I'm using android studio 3.0 and the latest gradle along with updated dependency versions and Im getting this error when I compile the project.
Error:Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'. java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex
I have tried cleaning and rebuilding the project, I have also done 'invalidate and restart' but they haven't worked for me so far...
Error:Execution failed for task ':app:compileDebugJava'.
When running gradle with java 6 or 7, you must set the path to jdk8, either with property retrolambda.jdk or environment variable JAVA8_HOME
Hi sir,
I have install this libray app and try to save the image text added, but not able to see the added text on image. Please help me , how can i resolve this issue to save the image with text
Might be like " https://github.com/afollestad/material-camera " ....
已经添加了标签,但最后合成的照片里没有。有可能什么问题?
我clone工程到as,build以后就出现这个:Error:Execution failed for task ':app:compileDebugJava'.
When running gradle with java 6 or 7, you must set the path to jdk8, either with property retrolambda.jdk or environment variable JAVA8_HOME
作者只提供了jdk8可以运行了吗?
为什么增加贴纸后合成出来的照片色彩明显缺损了?就算我不加滤镜和贴纸合成出来的照片色彩和原图也不对,这个事为啥?
error.
大牛您好,这里面的照片是正方形的,怎样修改成长方形4:3的呢。
我想自己修改发现里面Rect和Matrix不太懂
Matrix m = new Matrix();
m.setRotate(90, PHOTO_SIZE / 2, PHOTO_SIZE / 2);
if (mCurrentCameraId == 1) {
m.postScale(1, -1);
}
Bitmap rotatedImage = Bitmap.createBitmap(croppedImage, 0, 0, PHOTO_SIZE, PHOTO_SIZE, m, true);
想了解这些东西应该看那些资料。能不能推荐几个链接
Great project i learned lots of things from this code. I'm facing small issue I'm not able to save image. When i put a sticker on image then i click next to save the image now instead of saving the image it restarts the app .When app restart in the logs it generates below message
1643-1643/com.github.skykai.stickercamera D/Event﹕ No subscribers registered for event class com.stickercamera.app.model.FeedItem
1643-1643/com.github.skykai.stickercamera D/Event﹕ No subscribers registered for event class de.greenrobot.event.NoSubscriberEvent
Translated through google translate:
我不能保存图像。当我点击旁边而不是保存的图像是通过启动摄像机菜单重新从开始应用。
Wǒ bùnéng bǎocún túxiàng. Dāng wǒ diǎnjī pángbiān ér bùshì bǎocún de túxiàng shì tōngguò qǐdòng shèxiàngjī càidān chóngxīn cóng kāishǐ yìngyòng.
sava photo use //Bitmap.createBitmap(mImageView.getWidth(),mImageView.getHeight(),Bitmap.Config.ARGB_8888)
贴纸稍微多点就 非常容易内存溢出 不考虑用BitmapFactory.Options吗 或者有其它什么解决办法
相机方向旋转了180°,机型:Nexus 5x,系统:Android 6.0
现有的貌似只有选择效果 没有 进度条去修改吧?
我看了一下每次从PhotoProcessActivity返回到拍照界面CameraActivity里面时,相机默认变成后置,但是mCurrentCameraId还是保留上次的,CameraActivity加上下面的代码可以解决
@OverRide
protected void onResume() {
super.onResume();
mCurrentCameraId=0;
}
i am new to android and using eclipse ide
再加上手势控制就完美了
初步猜测是对大图没做处理
how can i add new sticker and when you clicked on sticker the app shows another image
你好,请问给图片添加文字的代码能单独给我下么
Error:A problem occurred configuring project ':app'.
Could not download hlistview.aar (it.sephiroth.android.library.horizontallistview:hlistview:1.2.2)
Could not get resource 'https://jcenter.bintray.com/it/sephiroth/android/library/horizontallistview/hlistview/1.2.2/hlistview-1.2.2.aar'.
> Could not GET 'https://jcenter.bintray.com/it/sephiroth/android/library/horizontallistview/hlistview/1.2.2/hlistview-1.2.2.aar'.
> peer not authenticated
vb
机型:meizu MX3
问题:相机拍摄时没有自动聚焦,点击后只显示小方块聚焦效果,然而并没有聚焦
CameraActivity中,saveToSDCard方法:
if (mCurrentCameraId == 1) {
r = new Rect(height - PHOTO_SIZE, 0, height, PHOTO_SIZE);
} else {
r = new Rect(0, 0, PHOTO_SIZE, PHOTO_SIZE);
}
请问这里为什么要根据不同的摄像头设定不同的截图范围呢,然后height-PHOTO_SIZE这个代表个啥呢,有点不理解,可以解答下吗?谢谢。
错误日志如下:
08-13 10:22:16.197 29841-29858/com.github.skykai.stickercamera E/System﹕ Uncaught exception thrown by finalizer
08-13 10:22:16.197 29841-29841/com.github.skykai.stickercamera E/art﹕ Throwing OutOfMemoryError "Failed to allocate a 28 byte allocation with 0 free bytes and 3GB until OOM" (recursive case)
08-13 10:22:16.197 29841-29841/com.github.skykai.stickercamera E/art﹕ "main" prio=5 tid=1 Runnable
08-13 10:22:16.197 29841-29841/com.github.skykai.stickercamera E/art﹕ | group="main" sCount=0 dsCount=0 obj=0x86479f88 self=0xb4e07800
08-13 10:22:16.197 29841-29841/com.github.skykai.stickercamera E/art﹕ | sysTid=29841 nice=-11 cgrp=apps sched=0/0 handle=0xb6f04ec8
08-13 10:22:16.197 29841-29841/com.github.skykai.stickercamera E/art﹕ | state=R schedstat=( 1037871833 557194121 2071 ) utm=87 stm=16 core=1 HZ=100
08-13 10:22:16.197 29841-29841/com.github.skykai.stickercamera E/art﹕ | stack=0xbe1bf000-0xbe1c1000 stackSize=8MB
08-13 10:22:16.197 29841-29841/com.github.skykai.stickercamera E/art﹕ | held mutexes= "mutator lock"(shared held)
08-13 10:22:16.197 29841-29841/com.github.skykai.stickercamera E/art﹕ at android.graphics.drawable.Drawable.getBounds(Drawable.java:259)
08-13 10:22:16.197 29841-29841/com.github.skykai.stickercamera E/art﹕ at android.graphics.drawable.ColorDrawable.getOutline(ColorDrawable.java:216)
08-13 10:22:16.197 29841-29841/com.github.skykai.stickercamera E/art﹕ at android.view.ViewOutlineProvider$1.getOutline(ViewOutlineProvider.java:38)
08-13 10:22:16.197 29841-29841/com.github.skykai.stickercamera E/art﹕ at android.view.View.rebuildOutline(View.java:12104)
08-13 10:22:16.197 29841-29841/com.github.skykai.stickercamera E/art﹕ at android.view.View.onAttachedToWindow(View.java:13995)
08-13 10:22:16.197 29841-29841/com.github.skykai.stickercamera E/art﹕ at android.view.ViewGroup.onAttachedToWindow(ViewGroup.java:4147)
08-13 10:22:16.197 29841-29841/com.github.skykai.stickercamera E/art﹕ at android.view.View.dispatchAttachedToWindow(View.java:14467)
08-13 10:22:16.197 29841-29841/com.github.skykai.stickercamera E/art﹕ at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3001)
08-13 10:22:16.197 29841-29841/com.github.skykai.stickercamera E/art﹕ at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3009)
08-13 10:22:16.197 29841-29841/com.github.skykai.stickercamera E/art﹕ at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3009)
08-13 10:22:16.197 29841-29841/com.github.skykai.stickercamera E/art﹕ at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3009)
08-13 10:22:16.197 29841-29841/com.github.skykai.stickercamera E/art﹕ ... repeated 1 times
08-13 10:22:16.197 29841-29841/com.github.skykai.stickercamera E/art﹕ at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1449)
08-13 10:22:16.197 29841-29841/com.github.skykai.stickercamera E/art﹕ at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1191)
08-13 10:22:16.197 29841-29841/com.github.skykai.stickercamera E/art﹕ at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6643)
08-13 10:22:16.197 29841-29841/com.github.skykai.stickercamera E/art﹕ at android.view.Choreographer$CallbackRecord.run(Choreographer.java:777)
08-13 10:22:16.197 29841-29841/com.github.skykai.stickercamera E/art﹕ at android.view.Choreographer.doCallbacks(Choreographer.java:590)
08-13 10:22:16.197 29841-29841/com.github.skykai.stickercamera E/art﹕ at android.view.Choreographer.doFrame(Choreographer.java:560)
08-13 10:22:16.197 29841-29841/com.github.skykai.stickercamera E/art﹕ at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:763)
08-13 10:22:16.197 29841-29841/com.github.skykai.stickercamera E/art﹕ at android.os.Handler.handleCallback(Handler.java:739)
08-13 10:22:16.197 29841-29841/com.github.skykai.stickercamera E/art﹕ at android.os.Handler.dispatchMessage(Handler.java:95)
08-13 10:22:16.197 29841-29841/com.github.skykai.stickercamera E/art﹕ at android.os.Looper.loop(Looper.java:145)
08-13 10:22:16.197 29841-29841/com.github.skykai.stickercamera E/art﹕ at android.app.ActivityThread.main(ActivityThread.java:5942)
08-13 10:22:16.197 29841-29841/com.github.skykai.stickercamera E/art﹕ at java.lang.reflect.Method.invoke!(Native method)
08-13 10:22:16.197 29841-29841/com.github.skykai.stickercamera E/art﹕ at java.lang.reflect.Method.invoke(Method.java:372)
08-13 10:22:16.197 29841-29841/com.github.skykai.stickercamera E/art﹕ at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1400)
08-13 10:22:16.197 29841-29841/com.github.skykai.stickercamera E/art﹕ at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1195)
08-13 10:22:16.197 29841-29841/com.github.skykai.stickercamera E/art﹕ [ 08-13 10:22:16.207 943: 1773 D/WifiService ]
startScan by pid=29780, uid=10324
当前的贴纸已经有了删除和拉伸旋转的功能,如果贴纸再增加镜像功能,楼主能给些建议吗?
项目中StickerDrawable是继承了BitmapDrawable,在BitmapDrawable或者Drawable中都没有给出重新设置bitmap的方法,Drawable中给出的setAutoMirror()和getLayoutDirection()是在api19和api23才加入的,低版本的情况下(如api14)没法使用。现在能想到的两个方案,一个是每次镜像的时候都重新生成一个StickerDrawable,然后设置给StickerView;或者就修改组件,不在使用StickerDrawable存放bitmap了,改成诸如ImageView之类的组件。
点击拍照时,感觉用AsyncTask来保存图片的byte[]有点慢,可不可以放到服务里面去保存图片,这样体验会好点。
Nexus 5,Android 6.0
后置摄像头,图片正常,点击切换摄像头,切换为前置摄像头,显示图像明显被拉伸,但是存储的图片没有拉伸。
这里我刚刚截获了 log 日志。
java.lang.RuntimeException: setParameters failed
at android.hardware.Camera.native_setParameters(Native Method)
at android.hardware.Camera.setParameters(Camera.java:1878)
at com.stickercamera.app.camera.ui.CameraActivity.initCamera(CameraActivity.java:486)
at com.stickercamera.app.camera.ui.CameraActivity.setUpCamera(CameraActivity.java:824)
at com.stickercamera.app.camera.ui.CameraActivity.switchCamera(CameraActivity.java:803)
at com.stickercamera.app.camera.ui.CameraActivity.lambda$initEvent$3(CameraActivity.java:198)
at com.stickercamera.app.camera.ui.CameraActivity.access$lambda$3(CameraActivity.java)
at com.stickercamera.app.camera.ui.CameraActivity$$Lambda$6.onClick(Unknown Source)
at android.view.View.performClick(View.java:5198)
at android.view.View$PerformClick.run(View.java:21147)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
![Example](http://osnftsiae.bkt.clouddn.com/Screenshot_2017-07-18-17-15-04-854_com.github.skykai.stickercamera.png =480x640)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.