Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions src/gab/opencv/OpenCV.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.IntBuffer;
import java.nio.charset.StandardCharsets;
import java.io.File;
import java.lang.reflect.Field;
import java.net.URL;
Expand Down Expand Up @@ -367,9 +368,14 @@ private void setupWorkingImages(){
private String getLibPath() {
URL url = this.getClass().getResource("OpenCV.class");
if (url != null) {
// Convert URL to string, taking care of spaces represented by the "%20"
// string.
String path = url.toString().replace("%20", " ");
String path = "";
try{
path = java.net.URLDecoder.decode(url.toString(), StandardCharsets.UTF_8.name());
}
catch(Exception e){
//not going to happen - value came from JDK's own StandardCharsets
e.printStackTrace();
}
int n0 = path.indexOf('/');

int n1 = -1;
Expand Down