package com.esafirm.imagepicker.model;

import android.content.ContentUris;
import android.net.Uri;
import android.os.Parcel;
import android.os.Parcelable;
import android.provider.MediaStore;

public class Image implements Parcelable {

    private long id;
    private String name;
    private String path;

    public Image(long id, String name, String path) {
        this.id = id;
        this.name = name;
        this.path = path;
    }

    public long getId() {
        return id;
    }

    public String getName() {
        return name;
    }

    public String getPath() {
        return path;
    }

    public Uri getUri() {
        return ContentUris.withAppendedId(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, id);
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Image image = (Image) o;
        return image.getPath().equalsIgnoreCase(getPath());
    }

    /* --------------------------------------------------- */
    /* > Parcelable */
    /* --------------------------------------------------- */

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeLong(this.id);
        dest.writeString(this.name);
        dest.writeString(this.path);
    }

    protected Image(Parcel in) {
        this.id = in.readLong();
        this.name = in.readString();
        this.path = in.readString();
    }

    public static final Creator<Image> CREATOR = new Creator<Image>() {
        @Override
        public Image createFromParcel(Parcel source) {
            return new Image(source);
        }

        @Override
        public Image[] newArray(int size) {
            return new Image[size];
        }
    };
}

@@ -186,16 +186,73 @@
 Store;%0A%0A
+import com.esafirm.imagepicker.helper.ImagePickerUtils;%0A%0A
 public c
@@ -299,16 +299,22 @@
 private 
+final 
 long id;
@@ -322,24 +322,30 @@
     private 
+final 
 String name;
@@ -357,16 +357,22 @@
 private 
+final 
 String p
@@ -377,16 +377,44 @@
  path;%0A%0A
+    private Uri uriHolder;%0A%0A
     publ
@@ -746,91 +746,335 @@
     
-return ContentUris.withAppendedId(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, id)
+if (uriHolder == null) %7B%0A            Uri contentUri = ImagePickerUtils.isVideoFormat(this)%0A                    ? MediaStore.Video.Media.EXTERNAL_CONTENT_URI%0A                    : MediaStore.Images.Media.EXTERNAL_CONTENT_URI;%0A            uriHolder = ContentUris.withAppendedId(contentUri, id);%0A        %7D%0A        return uriHolder
 ;%0A  

Fix 281 (#293)