Comments (5)
这个问题你解决了吗?
from smartcropper.
是有什么地方设置不对吗
解决了吗
from smartcropper.
解决了吗
没有作者都没有发解决方案
from smartcropper.
我在部分机型上遇到了这个问题
修复方案
@Override
public Bitmap getBitmap() {
Bitmap bmp = null;
Drawable drawable = getDrawable();
if (drawable instanceof BitmapDrawable) {
bmp = ((BitmapDrawable) drawable).getBitmap();
}
//修复裁剪区域不一致问题
if (bmp != null) {
int width = drawable.getIntrinsicWidth();
int height = drawable.getIntrinsicHeight();
int bitWidth = bmp.getWidth();
int bitHeight = bmp.getHeight();
if (width != bitWidth || height != bitHeight) {
Matrix matrix = new Matrix();
matrix.setScale(1.0f * width / bitWidth, 1.0f * height / bitHeight);
return Bitmap.createBitmap(bmp, 0, 0, bitWidth, bitHeight, matrix, true);
}
}
return bmp;
}
这两个方法获取出的 大小不一致造成的
private Point[] getFullImgCropPoints() {
Point[] points = new Point[4];
Drawable drawable = getDrawable();
if (drawable != null) {
int width = drawable.getIntrinsicWidth();
int height = drawable.getIntrinsicHeight();
points[0] = new Point(0, 0);
points[1] = new Point(width, 0);
points[2] = new Point(width, height);
points[3] = new Point(0, height);
}
return points;
}
public Bitmap getBitmap() {
Bitmap bmp = null;
Drawable drawable = getDrawable();
if (drawable instanceof BitmapDrawable) {
bmp = ((BitmapDrawable) drawable).getBitmap();
}
return bmp;
}
from smartcropper.
适配方案的原因
from smartcropper.
Related Issues (20)
- 库过大,40多M
- demo模拟器可以运行,真机不行 HOT 1
- error: undefined reference to 'fesetenv' HOT 1
- 集成后,应用加固后#5002 SIGABRT org.tensorflow.lite.NativeInterpreterWrapper.U(NativeInterpreterWrapper.java:13)
- CropImageView设置setImageBitmap后并没有出现剪裁区域
- signal 11 (SIGSEGV), code 2 (SEGV_ACCERR) split_config.arm64_v8a.apk!libsmart_cropper.so HOT 2
- java.lang.UnsatisfiedLinkError: dlopen failed: library "libsmart_cropper.so" not found HOT 2
- 银行卡磁条一面的轮廓怎么识别出来?
- build没问题,sync问题 HOT 1
- Canvas: trying to draw too large(192000000bytes) bitmap.
- Canvas: trying to draw too large(192000000bytes) bitmap.
- 裁剪后图片异常,目前只发现如下一张图片有问题
- 大佬,项目中的模型可直接用吗
- 大佬,代码中给的edge_detection,是否可以直接继续训练,和fengjian大神给的有什么区别
- 图片变形以及角度的自动矫正
- 请问作者大概训练了多少图片,以及迭代了多少次
- 有iOS版本的吗
- Tutorial for compiling the library
- 裁剪不规则形状图片会变形
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from smartcropper.