Updated some files, fixed #1, added mimetype recognition for the depth map
This commit is contained in:
parent
18f6e4e13f
commit
34f16eb4f9
8 changed files with 60 additions and 28 deletions
26
src/DepthMapNeedle.java
Normal file → Executable file
26
src/DepthMapNeedle.java
Normal file → Executable file
|
@ -14,13 +14,19 @@ public class DepthMapNeedle
|
|||
@Override
|
||||
public byte[] decode(byte[] data)
|
||||
{
|
||||
return Base64.getDecoder().decode(data);
|
||||
if(data != null)
|
||||
return Base64.getDecoder().decode(data);
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] encode(byte[] data)
|
||||
{
|
||||
return Base64.getEncoder().encode(data);
|
||||
if(data != null)
|
||||
return Base64.getEncoder().encode(data);
|
||||
else
|
||||
return null;
|
||||
}
|
||||
};
|
||||
//No arguments given or '-h' as first argument -> show help text
|
||||
|
@ -33,8 +39,8 @@ public class DepthMapNeedle
|
|||
{
|
||||
JPEG image = new JPEG(args[i], wrapper);
|
||||
if (image.exportDepthMap())
|
||||
System.out.println("Depthmap extracted for file "+args[i]+".");
|
||||
else System.err.println("There is no Depthmap in file "+args[i]);
|
||||
System.out.println("Info: Depthmap extracted for file "+args[i]+".");
|
||||
else System.out.println("Warning: There is no Depthmap in file "+args[i]+".");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -45,9 +51,9 @@ public class DepthMapNeedle
|
|||
{
|
||||
JPEG image = new JPEG(args[i], wrapper);
|
||||
if (image.exportSourceImage())
|
||||
System.out.println("Unblurred source image extracted for file "+args[i]+".");
|
||||
System.out.println("Info: Unblurred source image extracted for file "+args[i]+".");
|
||||
else
|
||||
System.err.println("There is no unblurred source image in file "+args[i]+". Maybe this photo has not been taken with the blur function?");
|
||||
System.out.println("Warning: There is no unblurred source image in file "+args[i]+". Maybe this photo has not been taken with Google Camera\'s blur function?");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -59,9 +65,9 @@ public class DepthMapNeedle
|
|||
{
|
||||
JPEG image = new JPEG(args[i], wrapper);
|
||||
if (image.injectDepthMap(depthmap))
|
||||
System.out.println("Depthmap injected into file "+args[i]+".");
|
||||
System.out.println("Info: Depthmap injected into file "+args[i]+".");
|
||||
else
|
||||
System.err.println("Something went wrong while injecting "+depthmap+" into "+args[i]+".\nRemember: The first argument has to be a png and the following arguments must be jpgs shot with the blur function.");
|
||||
System.out.println("Warning: Something went wrong while injecting "+depthmap+" into "+args[i]+".\nRemember: The first argument has to be a png and the following arguments must be jpgs shot with the blur function.");
|
||||
image.save();
|
||||
}
|
||||
}
|
||||
|
@ -73,9 +79,9 @@ public class DepthMapNeedle
|
|||
{
|
||||
JPEG image = new JPEG(args[i], wrapper);
|
||||
if (image.injectSourceImage(source))
|
||||
System.out.println("Source image injected into file "+args[i]+".");
|
||||
System.out.println("Info: Source image injected into file "+args[i]+".");
|
||||
else
|
||||
System.err.println("Something went wrong while injecting "+source+" into "+args[i]+".\nRemember: The first argument has to be a jpg and the following arguments must be jpgs shot with the blur function.");
|
||||
System.out.println("Warning: Something went wrong while injecting "+source+" into "+args[i]+".\nRemember: The first argument has to be a jpg and the following arguments must be jpgs shot with the blur function.");
|
||||
image.save();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue