If you are loading image with Fresco - yes:
public class OperationPostprocessor extends BasePostprocessor {
private int myParameter;
public OperationPostprocessor(int param) {
myParameter = param;
}
public void process(Bitmap bitmap) {
doSomething(myParameter);
}
public CacheKey getPostprocessorCacheKey() {
return new MyCacheKey(myParameter);
}
}
Cache key is MyCacheKey(myParameter)
You can use it when you are forming ImageRequest:
ImageRequest request = ImageRequestBuilder.newBuilderWithSource(photoUri)
.setPostprocessor(new OperationPostprocessor())
.build();
DraweeController controller = Fresco.newDraweeControllerBuilder()
.setOldController(simpleDraweeView.getController())
.setImageRequest(request)
.build();
simpleDraweeView.setController(controller);
Here you will use your postprocessor: .setPostprocessor(new OperationPostprocessor())
Resources:
One detail: here will be using fresco cache, but in Postprocessor.process(Bitmap) method, i think, you can add bitmap to your own cache.