Skip to content

Commit

Permalink
Bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
victormunoz committed Jun 28, 2016
1 parent af9a78c commit fe40ee6
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 21 deletions.
3 changes: 2 additions & 1 deletion dpf_manager.iml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@
<orderEntry type="library" name="Maven: aopalliance:aopalliance:1.0" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-beans:4.2.3.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-expression:4.2.3.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.xerial:sqlite-jdbc:3.8.11.2" level="project" />
<orderEntry type="library" name="Maven: com.h2database:h2:1.4.192" level="project" />
<orderEntry type="library" name="Maven: io.netty:netty-all:4.1.0.CR7" level="project" />
<orderEntry type="library" name="Maven: commons-codec:commons-codec:1.4" level="project" />
</component>
</module>
4 changes: 2 additions & 2 deletions package/linux/DPFManager.old.spec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Summary: DPF Manager
Name: dpf-manager
Version: 2.2
Version: 2.3
Release: 1
License: Unknown
Vendor: DPF Manager
Expand Down Expand Up @@ -69,4 +69,4 @@ fi

rm /usr/bin/dpf-manager

%clean
%clean
4 changes: 2 additions & 2 deletions package/windows/DPF Manager.iss
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{0D5B5F16-9992-49DC-AD65-D66FE249CE67}
AppName=DPF Manager
AppVersion=2.2
AppVersion=2.3
AppVerName=DPF Manager {#SetupSetting("AppVersion")}
AppPublisher=DPF Manager
AppComments=DPF Manager
Expand Down Expand Up @@ -87,4 +87,4 @@ end;
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<groupId>com.easyinnova</groupId>
<artifactId>dpf_manager</artifactId>
<packaging>jar</packaging>
<version>2.2</version>
<version>2.3</version>

<!--Properties-->
<properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,8 @@ boolean checkRule(RuleObject rule, TiffNode node) {

// Analyze clausules
for (String clausule : clausules.getClausules()) {
if (clausule.contains("*"))
clausule = clausule;
if (clausule.startsWith("count(")) {
// Child count
String countField = clausule.substring(clausule.indexOf("(") + 1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,18 @@ public class RuleElement {
TiffNode node;
TiffNode model;
public boolean valid;
String multiplier;

public RuleElement(String field, TiffNode nodeBase, TiffNode model) {
valid = true;
this.node = nodeBase;
this.model = model;
filter = null;
fieldName = field;
if (fieldName.contains("*")) {
multiplier = fieldName.substring(0, fieldName.indexOf("*"));
fieldName = fieldName.substring(fieldName.indexOf("*")+1);
}
if (!fieldName.startsWith("$")) {
while (fieldName.contains(".") || fieldName.contains("[")) {
int indexDot = fieldName.indexOf(".");
Expand Down Expand Up @@ -89,6 +94,14 @@ public List<TiffNode> getChildren() {
return node.getChildren(getName(), filter);
}

String operateMultiplier(String val) {
String value = val;
if (multiplier != null) {
value = (Integer.parseInt(val) * Integer.parseInt(multiplier)) + "";
}
return value;
}

public String getValue() {
if (fieldName.startsWith("$") && fieldName.endsWith("$")) {
String val = fieldName.replace("$", "");
Expand All @@ -104,16 +117,16 @@ public String getValue() {
if (node == null) return null;
}
val = node.getValue();
return val;
}
if (fieldName.startsWith("'") && fieldName.endsWith("'")) {
return operateMultiplier(val);
} else if (fieldName.startsWith("'") && fieldName.endsWith("'")) {
String val = fieldName.substring(1);
val = val.substring(0, val.length() - 1);
return val;
return operateMultiplier(val);
}

try {
int ival = Integer.parseInt(fieldName);
return ival + "";
return operateMultiplier(ival + "");
} catch (Exception ex) {

}
Expand Down Expand Up @@ -143,6 +156,6 @@ public String getValue() {
} else {
value = "";
}
return value;
return operateMultiplier(value);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1725,23 +1725,23 @@
<rules description="cardinality-formulas">
<rule context="ifd[class=image]">
<assert test="{tags.tag[name=JPEGLosslessPredictors].cardinality == tags.tag[name=SamplesPerPixel]}">Cardinality of JPEGLosslessPredictors tag must match SamplesPerPixel value</assert>
<reference></reference>
<reference>Section 22, page 107</reference>
</rule>
<rule context="ifd[class=image]">
<assert test="{tags.tag[name=JPEGPointTransforms].cardinality == tags.tag[name=SamplesPerPixel]}">Cardinality of JPEGPointTransforms tag must match SamplesPerPixel value</assert>
<reference></reference>
<reference>Section 22, page 107</reference>
</rule>
<rule context="ifd[class=image]">
<assert test="{tags.tag[name=JPEGQTables].cardinality == tags.tag[name=SamplesPerPixel]}">Cardinality of JPEGQTables tag must match SamplesPerPixel value</assert>
<reference></reference>
<reference>Section 22, page 107</reference>
</rule>
<rule context="ifd[class=image]">
<assert test="{tags.tag[name=JPEGDCTables].cardinality == tags.tag[name=SamplesPerPixel]}">Cardinality of JPEGDCTables tag must match SamplesPerPixel value</assert>
<reference></reference>
<reference>Section 22, page 107</reference>
</rule>
<rule context="ifd[class=image]">
<assert test="{tags.tag[name=JPEGACTables].cardinality == tags.tag[name=SamplesPerPixel]}">Cardinality of JPEGACTables tag must match SamplesPerPixel value</assert>
<reference></reference>
<reference>Section 22, page 107</reference>
</rule>
<rule context="ifd[class=image]">
<assert test="{tags.tag[name=WhiteLevel].cardinality == tags.tag[name=SamplesPerPixel]}">Cardinality of WhiteLevel tag must match SamplesPerPixel value</assert>
Expand All @@ -1753,26 +1753,34 @@
</rule>
<rule context="ifd[class=image]">
<assert test="{tags.tag[name=MinSampleValue].cardinality == tags.tag[name=SamplesPerPixel]}">Cardinality of MinSampleValue tag must match SamplesPerPixel value</assert>
<reference></reference>
<reference>Section 8, page 35</reference>
</rule>
<rule context="ifd[class=image]">
<assert test="{tags.tag[name=MaxSampleValue].cardinality == tags.tag[name=SamplesPerPixel]}">Cardinality of MaxSampleValue tag must match SamplesPerPixel value</assert>
<reference></reference>
<reference>Section 8, page 35</reference>
</rule>
<rule context="ifd[class=image]">
<assert test="{tags.tag[name=SMinSampleValue].cardinality == tags.tag[name=SamplesPerPixel]}">Cardinality of SMinSampleValue tag must match SamplesPerPixel value</assert>
<reference></reference>
<reference>Section 8, page 35</reference>
</rule>
<rule context="ifd[class=image]">
<assert test="{tags.tag[name=SMaxSampleValue].cardinality == tags.tag[name=SamplesPerPixel]}">Cardinality of SMaxSampleValue tag must match SamplesPerPixel value</assert>
<reference></reference>
<reference>Section 8, page 35</reference>
</rule>
<rule context="ifd[class=image]">
<assert test="{tags.tag[name=ImageBaseColor].cardinality == tags.tag[name=SamplesPerPixel]}">Cardinality of ImageBaseColor tag must match SamplesPerPixel value</assert>
<reference></reference>
</rule>
<rule context="ifd[class=image]">
<assert test="{tags.tag[name=SampleFormat].cardinality == tags.tag[name=SamplesPerPixel]}">Cardinality of SampleFormat tag must match SamplesPerPixel value</assert>
<reference>Section 19, page 80</reference>
</rule>
<rule context="ifd[class=image]">
<assert test="{tags.tag[name=CMYKEquivalent].cardinality == 4*tags.tag[name=SamplesPerPixel]}">CMYKEquivalent count must be 4*Bits per Sample</assert>
<reference>Section 16, page 69</reference>
</rule>
<rule context="ifd[class=image]">
<assert test="{tags.tag[name=Decode].cardinality == 2*tags.tag[name=Decode]}">Decode count must be 2*Bits per Sample</assert>
<reference></reference>
</rule>
</rules>
Expand Down

0 comments on commit fe40ee6

Please sign in to comment.