Skip to content

Commit

Permalink
Fix file paths related to no image reductions (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
hevrard authored Oct 3, 2018
1 parent 2cae4bc commit ad4244d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@
import java.io.File;
import java.io.IOException;
import java.nio.charset.Charset;
import java.nio.file.Paths;
import java.util.regex.Pattern;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.FilenameUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -62,16 +64,16 @@ public boolean isInteresting(File workDir, String shaderJobShortName) throws Fil
return false;
}
// 2.
File outputImage = new File(workDir, shaderJobShortName + ".png");

ImageJobResult imageRes = imageGenerator.getImage(shaderJobShortName, outputImage,
skipRender);
File outputImage = new File(workDir, FilenameUtils.getBaseName(shaderJobShortName) + ".png");
ImageJobResult imageRes = imageGenerator
.getImage(Paths.get(workDir.getAbsolutePath(), shaderJobShortName).toString(),
outputImage,
skipRender);
if (outputImage.isFile()) {
outputImage.delete();
}

File outputText = new File(workDir,
shaderJobShortName + ".txt");
File outputText = new File(workDir, FilenameUtils.getBaseName(shaderJobShortName) + ".txt");

switch (imageRes.getStatus()) {
case SUCCESS:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ private ImageJobResult getImageHelper(String shaderFilesPrefix,
final File vertexFile = new File(shaderFilesPrefix + ".vert");
final File primitivesFile = new File(shaderFilesPrefix + ".primitives");

assert uniformsFile.exists();

imageJob.setUniformsInfo(FileUtils.readFileToString(uniformsFile, Charset.defaultCharset()));

if (fragmentFile.isFile()) {
Expand Down

0 comments on commit ad4244d

Please sign in to comment.