Skip to content

Commit

Permalink
Fix for imagefilters not read from file
Browse files Browse the repository at this point in the history
  • Loading branch information
lanthale committed Nov 19, 2023
1 parent f5e2f86 commit 6415df8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ protected MediaFile call() throws Exception {

updateTitle("Reading cache...");
//restore cache
File inPath = new File(Utility.getAppData() + File.separatorChar + "cache" + File.separatorChar + createMD5Hash(selectedPath.toString()+"-") + selectedPath.toFile().getName() + ".bin");
File inPath = new File(Utility.getAppData() + File.separatorChar + "cache" + File.separatorChar + createMD5Hash(selectedPath.toString()) + "-" + selectedPath.toFile().getName() + ".bin");
FileInputStream fileInputStream;
try {
fileInputStream = new FileInputStream(inPath);
Expand Down Expand Up @@ -189,7 +189,7 @@ protected MediaFile call() throws Exception {
}
}
//save cache to disk
File outpath = new File(Utility.getAppData() + File.separatorChar + "cache" + File.separatorChar + createMD5Hash(selectedPath.toString()+"-") + selectedPath.toFile().getName() + ".bin");
File outpath = new File(Utility.getAppData() + File.separatorChar + "cache" + File.separatorChar + createMD5Hash(selectedPath.toString()) + "-" + selectedPath.toFile().getName() + ".bin");

FileOutputStream fileOutputStream;
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public static void convertToMediaFile(MediaFile_Serializable mserial, MediaFile
m.setStackPos(mserial.getStackPos());
m.setStacked(mserial.isStacked());
m.setPlace(mserial.getPlace());
m.setFaces(mserial.getFaces());
m.setFaces(mserial.getFaces());
m.setFilterList(mserial.convertToImageFilterList(mserial.getFilterList()));
m.setMediaType(mserial.getMediaType());
m.setTitle(mserial.getTitle());
Expand Down Expand Up @@ -379,7 +379,7 @@ public void setMediaType(MediaFile.MediaTypes mediaType) {
public ObservableList<ImageFilter> convertToImageFilterList(List<String> sourceList) {
ObservableList<ImageFilter> destinationList = FXCollections.observableArrayList();
ObjectMapper mapper = new ObjectMapper();
sourceList.forEach((filter) -> {
for (String filter : sourceList) {
StringTokenizer st = new StringTokenizer(filter, ";");
String fname = (String) st.nextElement();
String value = (String) st.nextElement();
Expand All @@ -393,7 +393,7 @@ public ObservableList<ImageFilter> convertToImageFilterList(List<String> sourceL
if (ifm != null) {
destinationList.add(ifm);
}
});
}
return destinationList;
}

Expand Down

0 comments on commit 6415df8

Please sign in to comment.