Skip to content

Commit

Permalink
Make JSON generation work with files with spaces.
Browse files Browse the repository at this point in the history
Fixes #57
  • Loading branch information
thvitt committed Jun 30, 2022
1 parent 7b1f0e9 commit d33d2f4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions convert.sh
Expand Up @@ -101,8 +101,8 @@ do
#create json metadata
echo " creating json metadata"
#json_file=$(echo "$file" | sed "s#^\.#"$output_metadata"#;s/\.tif$/\.json/" )
image_width=$(identify $file 2>/dev/null | sed -n '1 p' | cut -d\ -f3 | cut -dx -f1)
image_height=$(identify $file 2>/dev/null | sed -n '1 p' | cut -d\ -f3 | cut -dx -f2)
image_width=$(identify -format '%w' "$file" 2>/dev/null)
image_height=$(identify -format '%h' "$file" 2>/dev/null)
printf "{\n \"imageWidth\": %s,\n \"imageHeight\": %s,\n \"tileWidth\": %s,\n \"tileHeight\": %s,\n \"zoomLevels\": %s\n}" ${image_width} ${image_height} ${tile_width} ${tile_height} ${zoom_levels} > "${json_file}"


Expand Down

0 comments on commit d33d2f4

Please sign in to comment.