All Projects → ihimanshurawat → ImageWorker

ihimanshurawat / ImageWorker

Licence: other
ImageWorker is a Library for Android to Save Images in Internal Storage

Programming Languages

kotlin
9241 projects
java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to ImageWorker

ezored
C++ Multiplatform Toolkit Template
Stars: ✭ 111 (+117.65%)
Mutual labels:  development
fuse xattrs
add xattrs support using sidecar files.
Stars: ✭ 28 (-45.1%)
Mutual labels:  filesystem
mac-dev-setup
An easy script to install your mac dev environment
Stars: ✭ 38 (-25.49%)
Mutual labels:  development
loggedfs-python
Filesystem monitoring with Fuse and Python
Stars: ✭ 21 (-58.82%)
Mutual labels:  filesystem
hackathon
Repositório de hackathons do Training Center
Stars: ✭ 20 (-60.78%)
Mutual labels:  development
Windows-Whistler
A port of the Whistler theme that eventually got replaced by Luna in Windows 2001 (XP)
Stars: ✭ 24 (-52.94%)
Mutual labels:  development
tech-resources
🔧 A list of useful resources for tech enthusiasts. https://andou.github.io/tech-resources/
Stars: ✭ 25 (-50.98%)
Mutual labels:  development
secfs.test
Secfs Test Collection - Collection of File System Test Programs
Stars: ✭ 37 (-27.45%)
Mutual labels:  filesystem
vue-fs
A Vue file management client, complete with a node/express/FS backend.
Stars: ✭ 40 (-21.57%)
Mutual labels:  filesystem
tonix
Tonix provides basic file system functionality, as well as an interactive shell with a Unix-style command line interface.
Stars: ✭ 20 (-60.78%)
Mutual labels:  filesystem
webfuse
websocket filesystem based on libfuse
Stars: ✭ 23 (-54.9%)
Mutual labels:  filesystem
x64dbgpylib
Port of windbglib to x64dbgpy, in an effort to support mona.py in x64dbg.
Stars: ✭ 46 (-9.8%)
Mutual labels:  development
hdrfs
High Data Retention Filesystem
Stars: ✭ 23 (-54.9%)
Mutual labels:  filesystem
PS-HDD-Tools
PS3 and PS4 HDD tools
Stars: ✭ 28 (-45.1%)
Mutual labels:  filesystem
untheme
A blank WordPress theme for developers.
Stars: ✭ 82 (+60.78%)
Mutual labels:  development
SwiftFSWatcher
A simple easy to use / extend File System watcher using Swift
Stars: ✭ 35 (-31.37%)
Mutual labels:  filesystem
made-in-ghana
Open-source projects from Ghana.
Stars: ✭ 36 (-29.41%)
Mutual labels:  development
libraries-list
📋 Uma lista de bibliotecas mais usadas para frameworks front-end
Stars: ✭ 23 (-54.9%)
Mutual labels:  development
blimp
Web development with docker made easy
Stars: ✭ 12 (-76.47%)
Mutual labels:  development
woapp
web模拟安卓操作系统,php开发,内置文件管理,电话,短信,拍照,用在树莓派上可做智能家居,视频监控,机顶盒等……
Stars: ✭ 22 (-56.86%)
Mutual labels:  filesystem

ImageWorker

Android Arsenal "Buy Me A Coffee"

ImageWorker is the Library to handle all your Image needs Save, Retrieve, and Convert. To and From external storage dedicated for your application. For information you can refer the documentation: https://developer.android.com/about/versions/11/privacy/storage

** UPDATE 29/03/2021 **

Now the new Path where the files are store would be:

Internal shared storage\Android\data<your-app-package><your-specified-directory>

Note - It could be possible that the Directories are not visible File Managers for Android 11. So don't panic your content will be in Android\data<your-app-package><your-specified-directory><your-filename>

Raise issues if you have more queries.

Additional Notes

If you want to contine using the previous implementation then please modify the Manifest file.

Google Say's "If your app opts out of scoped storage when running on Android 10 devices, it's recommended that you continue to set requestLegacyExternalStorage to true in your app's manifest file. That way, your app can continue to behave as expected on devices that run Android 10."

Also, "Apps that run on Android 11 but target Android 10 (API level 29) can still request the requestLegacyExternalStorage attribute. This flag allows apps to temporarily opt out of the changes associated with scoped storage, such as granting access to different directories and different types of media files. After you update your app to target Android 11, the system ignores the requestLegacyExternalStorage flag."

You can't bypass this unless your application is a File Explorer, an Anti-virus etc.

Features

  • Save Bitmap, Drawable and Base64 encoded String directly to the External Storage. In following *.png, *.jpeg, and *.webp formats.
  • Retrieve saved files and use them as Bitmap.
  • Convert Bitmap to Drawable or Base64 and vice versa.

Pre-Requisite

  • Saving files would require WRITE_EXTERNAL_STORAGE permission.
  • Retrieving files would require READ_EXTERNAL_STORAGE permission.

Converting files doesn't require any special permission.

Usage

Guide to use ImageWorker Library

Add Dependencies

In Project Level Gradle

	allprojects {
		repositories {
			...
			maven { url 'https://jitpack.io' }
		}
	}

In Application Level Gradle

	dependencies {
	        implementation 'com.github.ihimanshurawat:ImageWorker:1.2.0'
	}

Save

  • Required Method to(arg = Context) is used to save Bitmap/Drawable/Base64
  • Method directory(arg = String Path) is used to create a directory. Multiple calling will result in the directory name of the last called function. ImageWorker should work even without calling directory() method because the default directory would be the package name of your application.
  • Method subDirectory(arg = String Path) is used to create a directory inside a directory. It can be nested to create directories inside directories.
  • Required Method setFileName(arg = String File Name) to set File Name.
  • Required Method withExtension(arg = Extension) the arguments of this method must be either one of these Extension.PNG, Extension.WEBP, and Extension.JPEG.
  • Required Method save(arg = bitmap and quality/drawable and quality/base64 and quality) default quality (Int) will be 100. quality must be 0 < quality <= 100
ImageWorker.to(context).
    directory("ImageWorker").
    subDirectory("SubDirectory").
    setFileName("Image").
    withExtension(Extension.PNG).
    save(sourceBitmap,85)

Retrieve

  • Required Method from(arg = Context) is used to retrieve saved files.
  • Method directory(arg = String Path) set directory where files is present. Multiple calling will result in the directory name of the last called function. ImageWorker should work even without calling directory() method because the default directory would be the package name of your application.
  • Method subDirectory(arg = String Path) is used to get file in a sub-directory. This method can be nested.
  • Required Method setFileName(arg = String File Name) to set File Name.
  • Required Method withExtension(arg = Extension) the arguments of this method must be either one of these Extension.PNG, Extension.WEBP, and Extension.JPEG.
  • Required Method load() will return Bitmap.
val bitmap: Bitmap? = ImageWorker.from(context).
    directory("ImageWorker").
    subDirectory("SubDirectory").
    setFileName("Image").
    withExtension(Extension.PNG).
    load()

Delete - Added in v1.2.0

  • Required Method from(arg = Context) is used to delete the saved images.
  • Method directory(arg = String Path) set directory where files is present. Multiple calling will result in the directory name of the last called function. ImageWorker should work even without calling directory() method because the default directory would be the package name of your application.
  • Method subDirectory(arg = String Path) is used to get file in a sub-directory. This method can create nested directories.
  • Required Method setFileName(arg = String File Name) to set File Name which you want to delete.
  • Required Method withExtension(arg = Extension) the arguments of this method must be either one of these Extension.PNG, Extension.WEBP, and Extension.JPEG.
  • Required Method delete() will delete Image File.
  • The function returns a boolean if the file is successfully deleted and vice versa.
  • To prevent missue, you can only delete files with the extensions .PNG, .JPEG, and .WEBP.
val bitmap: Bitmap? = ImageWorker.from(context).
    directory("ImageWorker").
    subDirectory("SubDirectory").
    setFileName("Image").
    withExtension(Extension.PNG).
    delete()

Convert

Methods to convert Bitmap to Drawable/Base64 String.

val drawable: Drawable? = ImageWorker.convert().bitmapToDrawable(inputBitmap)

val base64: String? = ImageWorker.convert().bitmapToBase64(inputBitmap)

Similar methods for Drawable and Base64.

Issues

Requires through testing for edge cases and large file sizes.

If you happen to found some don't hesitate to report em.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].