Module | Feature |
cloud-infinite (default module) | This module contains CI's basic image processing operations and supports freely combining various operations to build URLs for network requests. |
cloud-infinite-loader | This module uses the CIImageLoadRequest instance to request online images and return image data. |
TPG | This module decodes and displays general images and TPG images. |
AVIF | This module decodes and displays general images and AVIF images. |
cloud-infinite-glide | This module depends on the glide and cloud-infinite modules to provide CI's basic image processing features. |
cloud-infinite
module has the following main features:build.gradle
file (usually in the root directory):repositories {google()// Add the following linemavenCentral()}
build.gradle
of your app or other class libraries:implementation 'com.qcloud.cos:cloud-infinite:1.2.1'
CloudInfinite cloudInfinite = new CloudInfinite();
CITransformation
and set related operations. The following takes TPG as an example. For more features, see Basic Image Processing.CITransformation transform = new CITransformation();transform.format(CIImageFormat.TPG, CIImageLoadOptions.LoadTypeUrlFooter)
CIImageLoadRequest request = cloudInfinite.requestWithBaseUrlSync(objectUrl, transform);// Image URLURL imageURL = request.getUrl();// Header parameterMap<String, List<String>> heaers = request.getHeaders();
cloudInfinite.requestWithBaseUrl(objectUrl, transform, new CloudInfiniteCallback() {@Overridepublic void onImageLoadRequest(@NonNull final CIImageLoadRequest request) {// Image URLURL imageURL = request.getUrl();// Header parameterMap<String, List<String>> heaers = request.getHeaders();}});
options
is set to LoadTypeAcceptHeader
.implementation 'com.qcloud.cos:cloud-infinite-loader:1.2.1'
<uses-permission android:name="android.permission.INTERNET" />
CIImageLoader ciImageLoader = new CIImageLoader();ciImageLoader.display(request, imageview);
CIImageLoader ciImageLoader = new CIImageLoader();ciImageLoader.loadData(request, new CIImageLoadDataCallBack() {@Overridepublic void onLoadData(byte[] bytes) {// Use the pseudocode to set bytes data for the imageview//imageview.setBytes(bytes);}@Overridepublic void onFailure(QCloudClientException clientException, QCloudServiceException serviceException) {}});
Was this page helpful?