huangyz0918 / androidwm Goto Github PK
View Code? Open in Web Editor NEWAn android image watermark library that supports steganography.
Home Page: http://huangyz.name/AndroidWM/
License: Apache License 2.0
An android image watermark library that supports steganography.
Home Page: http://huangyz.name/AndroidWM/
License: Apache License 2.0
如果用户加了主题样式(比如是拼音)该怎么处理
希望增加文本换行功能
Invisible watermark in frequency domain. Build in C++.
现在的需求是有二排 每排字数不固定
想要在下面加一个透明度的底色 铺满整行屏幕的宽度
A/libc: Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0xc7980000 in tid 23057 (AsyncTask #1), pid 21895 (scenery.toolbox)
生成水印后,图片就逆时针旋转了90度,导致展示的时候竖着拍的图片都是横向压缩显示了
As title.
请问:空域 LSB 水印添加之后,截屏,再用程序decode时,解不出来,为什么呢?抗干扰能力弱的原因吗?
不支持文本换行?
If I have image that width and height is both < 1024. This lib create the bitmap set one to 1024.
private WatermarkBuilder(@NonNull Context context, @NonNull Bitmap backgroundImg) {
this.context = context;
this.backgroundImg = resizeBitmap(backgroundImg, MAX_IMAGE_SIZE);
}
public static Bitmap resizeBitmap(Bitmap inputBitmap, int maxImageSize) {
float ratio = Math.min(
(float) maxImageSize / inputBitmap.getWidth(),
(float) maxImageSize / inputBitmap.getHeight());
int width = Math.round(ratio * inputBitmap.getWidth());
int height = Math.round(ratio * inputBitmap.getHeight());
return Bitmap.createScaledBitmap(inputBitmap, width,
height, true);
}
Does this necessary, or it's bug?
LSB has a very weak robustness, so we need to make it better.
github master分支代码不全吗?运行起来各种crash 和 失败
日志如下:
Caused by: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file "/data/app/com.xiachufang-BzBASljGJfTQVm4wk-NAIA==/base.apk"],nativeLibraryDirectories=[/data/app/com.xiachufang-BzBASljGJfTQVm4wk-NAIA==/lib/arm, /data/app/com.xiachufang-BzBASljGJfTQVm4wk-NAIA==/base.apk!/lib/armeabi, /system/lib, /product/lib]]] couldn't find "libWatermark.so"
In the LSBWatermarkTask
:
int[] rebuiltPixels = new int[backgroundPixels.length];
We will get a out of memory error while init a large int array.
Caused by: java.lang.OutOfMemoryError: Failed to allocate a 10485772 byte allocation with 9612332 free bytes and 9MB until OOM
at com.watermark.androidwm.task.LSBWatermarkTask.doInBackground(LSBWatermarkTask.java:122)
at com.watermark.androidwm.task.LSBWatermarkTask.doInBackground(LSBWatermarkTask.java:40)
at android.os.AsyncTask$2.call(AsyncTask.java:292)
Consider using a BitSet
to refactor the code.
为什么第一进入界面不显示水印,第二次才显示出来?
WatermarkText watermarkText = new WatermarkText(text)
.setPositionX(0.5)
.setPositionY(0.5)
.setTextAlpha(80)
.setTextColor(getResources().getColor(R.color.color_FFFFFF))
// .setTextFont(R.font.champagne)
.setTextShadow(0.1f, 5, 5, getResources().getColor(R.color.color_5052c3));
WatermarkBuilder.create(getContext(), mImgBottom)
.setTileMode(true)
.loadWatermarkText(watermarkText)
.getWatermark()
.setToImageView(mImgBottom);
When using StringBuilder
to build a very long string from an array, the method intArrayToString
will throws an Out of Memory exception.
divide the input array to multiple subarrays, and use different StringBuilder to append the strings together.
Fix this by adding the judgement: && !detectionReturnValue.getWatermarkString().equals("")
.
使用 覆盖模式 时,水印覆盖的密度比文档中显示的要密集。
请问有没有办法调节呢
看文档只能给imageview
CMake Error: CMake was unable to find a build program corresponding to "Ninja". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
We have two gifs in the invisible watermark section, with the code comes to the newer version, the demo gifs have been out of date, I think we can update it using the newest version of demo.
All you need is to:
README.md
and README-CN.md
.Note: The gifs cannot be too large or it will take a really long time to load.
Hi, I can see that you a simple logo. What do you think about having an image upgrade (A banner for the GitHub project or any other graphics that your app would need).
I can sent you some drafts if you like. I`m thinking about some ideas, I can send you some drafts in a few hours
Let me know what do you think.
The callback will return two overwrite methods, but it's obviously impossible for us to get both image and text watermarks from single image, we should redesign the calling methods.
Android resource linking failed
Output: /Users/l/nutstore-android-scanner/app/build/intermediates/incremental/merge360DebugResources/merged.dir/values-v28/values-v28.xml:7: error: resource android:attr/dialogCornerRadius not found.
/Users/l/nutstore-android-scanner/app/build/intermediates/incremental/merge360DebugResources/merged.dir/values-v28/values-v28.xml:11: error: resource android:attr/dialogCornerRadius not found.
/Users/l/nutstore-android-scanner/app/build/intermediates/incremental/merge360DebugResources/merged.dir/values/values.xml:1460: error: resource android:attr/fontVariationSettings not found.
/Users/l/nutstore-android-scanner/app/build/intermediates/incremental/merge360DebugResources/merged.dir/values/values.xml:1461: error: resource android:attr/ttcIndex not found.
error: failed linking references.
Command: /Users/l/.gradle/caches/transforms-1/files-1.1/aapt2-3.2.1-4818971-osx.jar/476c266d41ea4fead5273b51b58e0dce/aapt2-3.2.1-4818971-osx/aapt2 link -I\
/Users/l/Library/Android/sdk/platforms/android-27/android.jar\
--manifest\
/Users/l/nutstore-android-scanner/app/build/intermediates/merged_manifests/360Debug/process360DebugManifest/merged/AndroidManifest.xml\
-o\
/Users/l/nutstore-android-scanner/app/build/intermediates/processed_res/360Debug/process360DebugResources/out/resources-360Debug.ap_\
-R\
@/Users/l/nutstore-android-scanner/app/build/intermediates/incremental/process360DebugResources/resources-list-for-resources-360Debug.ap_.txt\
--auto-add-overlay\
--java\
/Users/l/nutstore-android-scanner/app/build/generated/not_namespaced_r_class_sources/360Debug/process360DebugResources/r\
--proguard-main-dex\
/Users/l/nutstore-android-scanner/app/build/intermediates/legacy_multidex_aapt_derived_proguard_rules/360Debug/process360DebugResources/manifest_keep.txt\
--custom-package\
nutstore.android.scanner\
-0\
apk\
--output-text-symbols\
/Users/l/nutstore-android-scanner/app/build/intermediates/symbols/360/debug/R.txt\
--no-version-vectors
Daemon: AAPT2 aapt2-3.2.1-4818971-osx Daemon #0
水印不能换行,1、当文字多了的时候,希望能换行。2、当有回车换行符的时候希望能正常显示水印。
To make sure the text size can be auto adjusted by the size of background image, to use a proportion of the background width, from 0 to 1.
When creating a WatermarkImage
with a vector drawable resource, generating the final watermark via:
WatermarkBuilder.create(context, backgroundBitmap) .loadWatermarkImage(waterMarkImage) .getWatermark()
throws a NullPointerException
Here is the full stacktrace:
java.lang.NullPointerException: Attempt to invoke virtual method 'int android.graphics.Bitmap.getWidth()' on a null object reference
2020-11-03 10:50:39.603 2574-2754/com.buckdown.android W/System.err: at com.watermark.androidwm_light.utils.BitmapUtils.resizeBitmap(BitmapUtils.java:124)
2020-11-03 10:50:39.603 2574-2754/com.buckdown.android W/System.err: at com.watermark.androidwm_light.Watermark.createWatermarkImage(Watermark.java:112)
2020-11-03 10:50:39.603 2574-2754/com.buckdown.android W/System.err: at com.watermark.androidwm_light.Watermark.(Watermark.java:75)
不同大小的图片,有的图片会溢出,怎么计算水印的长度,再去设置位置?或者要是能实现设置右边距、下边距这样最好!
新建项目之后,使用数字水印有如下报错:
Error:Error converting bytecode to dex:
Cause: Dex cannot parse version 52 byte code.
This is caused by library dependencies that have been compiled using Java 8 or above.
If you are using the 'java' gradle plugin in a library submodule add
targetCompatibility = '1.7'
sourceCompatibility = '1.7'
to that submodule's build.gradle file.
尝试了网上的方法添加:
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
以及
jackOptions {
enabled true
}
仍然不行,想请问要怎么解决
大佬不维护了吗?
The FFT operation is really fast while using the library: JTransforms, but the package size is too large. We need to implement the FFT using C++ by our self. Maybe we can set two versions of the androidwm.
Like this:
I introduced the NDK in previous commit. We can refactor some methods in C++ to improve the performance.
Caused by: java.lang.IllegalArgumentException: width and height must be > 0
at android.graphics.Bitmap.createBitmap(Bitmap.java:810)
at android.graphics.Bitmap.createBitmap(Bitmap.java:789)
at android.graphics.Bitmap.createBitmap(Bitmap.java:720)
at com.watermark.androidwm.utils.BitmapUtils.resizeBitmap(BitmapUtils.java:153)
at com.watermark.androidwm.Watermark.createWatermarkImage(Watermark.java:153)
at com.watermark.androidwm.Watermark.<init>(Watermark.java:94)
at com.watermark.androidwm.WatermarkBuilder.setInvisibleWMListener(WatermarkBuilder.java:253)
at com.example.huangyz0918.myapplication.MainActivity.onCreate(MainActivity.java:35)
at android.app.Activity.performCreate(Activity.java:5990)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278)
in method resizeBitmap()
.
老哥,我使用一张透明的图片设置水印之后图片变成了黑色,要保持它的透明度需要什么特殊的处理吗
在使用该水印功能时,低概率会出现内存溢出的问题,这个能解决下吗?
java.lang.OutOfMemoryError
at android.graphics.Bitmap.nativeCreate(Native Method)
at android.graphics.Bitmap.createBitmap(Bitmap.java:1165)
at android.graphics.Bitmap.createBitmap(Bitmap.java:1115)
at android.graphics.Bitmap.createBitmap(Bitmap.java:1065)
at android.graphics.Bitmap.createBitmap(Bitmap.java:1026)
at com.watermark.androidwm_light.Watermark.createWatermarkText(Watermark.java:159)
at com.watermark.androidwm_light.Watermark.(Watermark.java:85)
at com.watermark.androidwm_light.WatermarkBuilder.getWatermark(WatermarkBuilder.java:250)
at com.csi.sec.utils.WaterMarkUtils.getWaterMarkBitmap(WaterMarkUtils.java:266)
at com.csi.sec.utils.WaterMarkUtils.getDefaultWaterMarkBitmap(WaterMarkUtils.java:164)
at com.csi.sec.workspace.meeting.activity.InviteesActivity.setWatermark(InviteesActivity.java:483)
at com.csi.sec.workspace.meeting.activity.InviteesActivity.access$1500(InviteesActivity.java:86)
at com.csi.sec.workspace.meeting.activity.InviteesActivity$4.onGlobalLayout(InviteesActivity.java:472)
at android.view.ViewTreeObserver.dispatchOnGlobalLayout(ViewTreeObserver.java:1082)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:3210)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:2225)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:9126)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:999)
at android.view.Choreographer.doCallbacks(Choreographer.java:797)
at android.view.Choreographer.doFrame(Choreographer.java:732)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:984)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:237)
at android.app.ActivityThread.main(ActivityThread.java:8167)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:496)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1100)
请问有demo的release版本app吗?很想找一个盲水印的app
in LSBDetectionTask
, binaryToStringJ
will throws the abnormal ArrayIndexOutOfBoundsException.
Refactor the code using NDK may fix this issue.
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.