Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

parseIdentify() : skip also lines containing only whitespace #62

Merged
merged 1 commit into from over 1 year ago

2 participants

nuarhu Rasmus Andersson
nuarhu

Hi,

identify output containing lines with only whitespace leads to an exception in line 156 (today's master). The stdout from identify contains:

Properties:
  date:create: 2012-10-17T09:08:35+02:00
  date:modify: 2012-10-17T09:08:35+02:00
  exif:Artist: Corbis
  exif:Compression: 6
  exif:YResolution: 72/1
  jpeg:colorspace: 2
  jpeg:sampling-factor: 1x1,1x1,1x1
  MicrosoftPhoto:Rating: 63
  rdf:Alt: 


  signature: c259218a328758e7fa45b1bb3451469f8745cbe8800b6c7f7f308c7d3b875ed1
  unknown: 4
  xmp:CreateDate: 2008-02-11T19:32:43.173Z
  xmp:Rating: 4
Profiles:
  Profile-exif: 5153 bytes
  Profile-xmp: 2895 bytes

I have removed some lines to shorten it, but this is only about the seemingly empty lines in the middle: they contain several tabs.

The failing image is one included by default with Windows7 (Koala.jpg). It is processed fine after the fix.

Rasmus Andersson rsms merged commit b830fe9 into from October 19, 2012
Rasmus Andersson rsms closed this October 19, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Oct 17, 2012
parseIdentify() skips empty lines and lines containing only whitespace. d55203e
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 2 additions and 2 deletions. Show diff stats Hide diff stats

  1. 4  imagemagick.js
4  imagemagick.js
@@ -110,8 +110,8 @@ function parseIdentify(input) {
110 110
 
111 111
   for (i in lines) {
112 112
     currentLine = lines[i];
113  
-    if (currentLine.length > 0) {
114  
-      indent = currentLine.search(/\S/);
  113
+    indent = currentLine.search(/\S/);
  114
+    if (indent >= 0) {
115 115
       comps = currentLine.split(': ');
116 116
       if (indent > prevIndent) indents.push(indent);
117 117
       while (indent < prevIndent && props.length) {
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.