Skip to content

Commit

Permalink
Fixes issue #38
Browse files Browse the repository at this point in the history
  • Loading branch information
victormunoz committed Oct 11, 2016
1 parent cf79690 commit 272018e
Show file tree
Hide file tree
Showing 21 changed files with 597 additions and 321 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -37,7 +37,7 @@ If you want to build the code from source you'll require:
####Downloading the latest release source
You can use [Git](https://git-scm.com/) to download the source code.
```
git clone https://github.com/EasyinnovaSL/TiffLibrary.git
git clone https://github.com/EasyinnovaSL/Tiff-Library-4J.git
```
or download the latest release from [GitHub] (https://github.com/EasyinnovaSL/Tiff-Library-4J/releases).

Expand Down
10 changes: 9 additions & 1 deletion pom.xml
Expand Up @@ -5,7 +5,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/ma
<modelVersion>4.0.0</modelVersion>
<groupId>com.easyinnova</groupId>
<artifactId>tifflibrary4java</artifactId>
<version>1.6</version>
<version>1.7</version>
<packaging>jar</packaging>
<name>Tiff Library 4 Java</name>
<description>A library to read and give access to Tiff files.</description>
Expand Down Expand Up @@ -36,6 +36,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/ma
<groupId>junit</groupId>
<artifactId>junit-dep</artifactId>
<version>4.8.2</version>
<scope>test</scope>
</dependency>

<!-- https://mvnrepository.com/artifact/com.adobe.xmp/xmpcore -->
Expand All @@ -44,6 +45,13 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/ma
<artifactId>xmpcore</artifactId>
<version>5.1.2</version>
</dependency>

<!-- https://github.com/vnesek/nmote-iim4j -->
<dependency>
<groupId>com.nmote.iim4j</groupId>
<artifactId>nmote-iim4j</artifactId>
<version>1.0.0</version>
</dependency>
</dependencies>
<developers>
<developer>
Expand Down
Expand Up @@ -21,6 +21,7 @@ public class MappedByteInputStream extends InputStream {
private long mbsize;
private FileChannel ch;
private FileInputStream f;
private String path;

/**
* Instantiates a new tiff file input stream.
Expand All @@ -29,6 +30,7 @@ public class MappedByteInputStream extends InputStream {
* @throws FileNotFoundException the file not found exception
*/
public MappedByteInputStream(File file) throws FileNotFoundException {
path = file.getPath();
f = new FileInputStream(file);
ch = f.getChannel();
try {
Expand All @@ -39,6 +41,10 @@ public MappedByteInputStream(File file) throws FileNotFoundException {
}
}

public String getPath() {
return path;
}

@Override public int read() throws IOException {
int val2;
try {
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/com/easyinnova/tiff/io/OutputBuffer.java
Expand Up @@ -76,6 +76,10 @@ public OutputBuffer(ByteOrder byteOrder) {
}
}

public RandomAccessFile getStream() {
return aFile;
}

/**
* Creates the file.
*
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/com/easyinnova/tiff/io/TiffInputStream.java
Expand Up @@ -86,6 +86,10 @@ public ByteOrder getByteOrder() {
return byteOrder;
}

public String getFilePath() {
return getPath();
}

/**
* Gets the stream.
*
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/com/easyinnova/tiff/io/TiffOutputStream.java
Expand Up @@ -40,6 +40,7 @@
import com.easyinnova.tiff.model.types.SShort;

import java.io.IOException;
import java.io.RandomAccessFile;
import java.nio.ByteOrder;

/**
Expand Down Expand Up @@ -70,6 +71,10 @@ public TiffOutputStream(TiffInputStream in) {
output = new OutputBuffer(byteOrder);
}

public RandomAccessFile getOutputStream() {
return output.getStream();
}

/**
* Gets the byte order.
*
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/com/easyinnova/tiff/model/Metadata.java
Expand Up @@ -56,12 +56,13 @@ public Metadata() {
* @param name the name
* @param value the value
*/
public void add(String name, TiffObject value, String path) {
public void add(String name, TiffObject value, String path, String schema) {
if (!metadata.containsKey(name)) {
metadata.put(name, new MetadataObject());
}
metadata.get(name).getObjectList().add(value);
metadata.get(name).setPath(path);
metadata.get(name).setSchema(schema);
}

/**
Expand Down
18 changes: 18 additions & 0 deletions src/main/java/com/easyinnova/tiff/model/MetadataObject.java
Expand Up @@ -46,6 +46,7 @@ public class MetadataObject {

/** The path. */
private String path;
private String schema;

/**
* Instantiates a new metadata object.
Expand Down Expand Up @@ -83,6 +84,23 @@ public void setPath(String path) {
this.path = path;
}

/**
* Gets the path.
*
*/
public String getSchema() {
return schema;
}

/**
* Sets the path.
*
* @param schema the new checks if is dublin core
*/
public void setSchema(String schema) {
this.schema = schema;
}

/**
* Gets the path.
*
Expand Down

0 comments on commit 272018e

Please sign in to comment.