Skip to content

Commit

Permalink
Merge pull request #4999 from salachi/TIMOB-15746
Browse files Browse the repository at this point in the history
TIMOB-15746-add mimetype to the dictionary
  • Loading branch information
pingwang2011 committed Dec 10, 2013
2 parents 2b752af + bee2003 commit e812e86
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ public class TiUIHelper
public static final int FACE_DOWN = 6;
public static final int UNKNOWN = 7;
public static final Pattern SIZED_VALUE = Pattern.compile("([0-9]*\\.?[0-9]+)\\W*(px|dp|dip|sp|sip|mm|pt|in)?");
public static final String MIME_TYPE_PNG = "image/png";

private static Method overridePendingTransition;
private static Map<String, String> resourceImageKeys = Collections.synchronizedMap(new HashMap<String, String>());
Expand Down Expand Up @@ -590,14 +591,15 @@ public static KrollDict createDictForImage(int width, int height, byte[] data)
d.put(TiC.PROPERTY_Y, 0);
d.put(TiC.PROPERTY_WIDTH, width);
d.put(TiC.PROPERTY_HEIGHT, height);
d.put(TiC.PROPERTY_MIMETYPE, MIME_TYPE_PNG);

KrollDict cropRect = new KrollDict();
cropRect.put(TiC.PROPERTY_X, 0);
cropRect.put(TiC.PROPERTY_X, 0);
cropRect.put(TiC.PROPERTY_WIDTH, width);
cropRect.put(TiC.PROPERTY_HEIGHT, height);
d.put(TiC.PROPERTY_CROP_RECT, cropRect);
d.put(TiC.PROPERTY_MEDIA, TiBlob.blobFromData(data, "image/png"));
d.put(TiC.PROPERTY_MEDIA, TiBlob.blobFromData(data, MIME_TYPE_PNG));

return d;
}
Expand Down

0 comments on commit e812e86

Please sign in to comment.