Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
arnoudbuzing committed May 18, 2018
1 parent 6ffc5a6 commit 98601a1
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 16 deletions.
15 changes: 0 additions & 15 deletions Prototypes/Files.wl
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,3 @@ If[ $SystemID === "Windows-x86-64",
$LocalAppDataDirectory = FileNameJoin[{$AppDataDirectory, "Local"}];
$RoamingAppDataDirectory = FileNameJoin[{$AppDataDirectory, "Roaming"}];
]



FormatDetect[ format_String, data:(_String|_List|_ByteArray)] := Module[ {ba},
ba = Switch[ data,
_String, StringToByteArray[data],
_List, ByteArray[data],
_ByteArray, data
];
Which[
format === "PNG", SameQ[ ba, ByteArray[{137, 80, 78, 71, 13, 10, 26, 10}] ],
format === "JPEG" || format === "JPG", SameQ[ ba, ByteArray[{255,216,255}] ],
format === "GIF", SameQ[ ba, ByteArray[{71,73,70,56}] ]
]
]
12 changes: 12 additions & 0 deletions Prototypes/Formats.wl
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FormatDetect[ format_String, data:(_String|_List|_ByteArray)] := Module[ {ba},
ba = Switch[ data,
_String, StringToByteArray[data],
_List, ByteArray[data],
_ByteArray, data
];
Which[
format === "PNG", SameQ[ ba, ByteArray[{137, 80, 78, 71, 13, 10, 26, 10}] ],
format === "JPEG" || format === "JPG", SameQ[ ba, ByteArray[{255,216,255}] ],
format === "GIF", SameQ[ ba, ByteArray[{71,73,70,56}] ]
]
]
2 changes: 1 addition & 1 deletion Prototypes/Prototypes.wl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Module[ {files},

(* load in any session *)
files = {"Build.wl", "Dataset.wl", "Files.wl",
"Image.wl", "Language.wl", "Paclet.wl",
"Image.wl", "Language.wl", "Paclet.wl", "Formats.wl",
"Resources.wl", "Search.wl", "String.wl", "Color.wl",
"Entities.wl", "WolframAlpha.wl", "Translation.wl","GeoGraphics.wl"};
Map[ Get[ FileNameJoin[{DirectoryName[$InputFileName], #}] ] &, files ];
Expand Down

0 comments on commit 98601a1

Please sign in to comment.