{"action":"created","issue":{"url":"https://api.github.com/repos/systemed/tilemaker/issues/13","labels_url":"https://api.github.com/repos/systemed/tilemaker/issues/13/labels{/name}","comments_url":"https://api.github.com/repos/systemed/tilemaker/issues/13/comments","events_url":"https://api.github.com/repos/systemed/tilemaker/issues/13/events","html_url":"https://github.com/systemed/tilemaker/issues/13","id":98554473,"number":13,"title":"tile_data column doesn't seem to be an image","user":{"login":"AndreMiras","id":24973,"avatar_url":"https://avatars.githubusercontent.com/u/24973?v=3","gravatar_id":"","url":"https://api.github.com/users/AndreMiras","html_url":"https://github.com/AndreMiras","followers_url":"https://api.github.com/users/AndreMiras/followers","following_url":"https://api.github.com/users/AndreMiras/following{/other_user}","gists_url":"https://api.github.com/users/AndreMiras/gists{/gist_id}","starred_url":"https://api.github.com/users/AndreMiras/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AndreMiras/subscriptions","organizations_url":"https://api.github.com/users/AndreMiras/orgs","repos_url":"https://api.github.com/users/AndreMiras/repos","events_url":"https://api.github.com/users/AndreMiras/events{/privacy}","received_events_url":"https://api.github.com/users/AndreMiras/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-08-01T18:35:37Z","updated_at":"2015-08-01T19:20:16Z","closed_at":"2015-08-01T19:07:09Z","body":"Isn't \"tile_data\" supposed to be jpg or png image?\r\nBecause when I dump it to a file it's not recognised as an image, but just \"data\".\r\n\r\nThis is the script I used for dumping:\r\n```python\r\n#!/usr/bin/env python2\r\nimport sys\r\nimport sqlite3\r\nimport tempfile\r\n\r\ndatabase = sys.argv[1]\r\nconn = sqlite3.connect(database)\r\nc = conn.cursor()\r\nc.execute(\"SELECT zoom_level, tile_column, tile_row, tile_data FROM tiles\")\r\nrow = c.fetchone()\r\n(zoom_level, tile_column, tile_row, tile_data) = row\r\n# we're only interested in non-empty data\r\nwhile len(tile_data) == 0:\r\n    row = c.fetchone() # fetch next one\r\n    (zoom_level, tile_column, tile_row, tile_data) = row\r\n    # print \"row(zoom_level, tile_column, tile_row, tile_data):\", row\r\nconn.close()\r\nf = tempfile.NamedTemporaryFile(delete=False, suffix=\".data\")\r\nf.write(tile_data)\r\nf.close()\r\nprint \"tile_data dumped to:\", f.nam\r\n```\r\nRunning the script:\r\n```\r\n$ ./dump_tile_data.py languedoc-rousillon.mbtiles \r\ntile_data dumped to: /tmp/tmpwJ1G_H.data\r\n$ file /tmp/tmpwJ1G_H.data\r\n/tmp/tmpwJ1G_H.data: data\r\n```\r\nHowever, when I try with another mbtiles which is not made from Tilemaker, the dumped data is actually a png:\r\n```\r\n$ ./dump_tile_data.py montpellier.mbtiles \r\ntile_data dumped to: /tmp/tmpyMet0n.data\r\n$ file /tmp/tmpyMet0n.data\r\n/tmp/tmpyMet0n.data: PNG image data, 256 x 256, 8-bit colormap, non-interlaced\r\n```\r\n\r\nAdditional information:\r\n * languedoc-rousillon.mbtiles was generated with Tilemaker (master branch 6a994eed22fa84c5f879f65bf9b92a85ed4a486b) and ```\"compress\": false```, the pbf was downloaded from Geofabrik\r\n * montpellier.mbtiles was generated with [makinacorpus/landez](https://github.com/makinacorpus/landez)"},"comment":{"url":"https://api.github.com/repos/systemed/tilemaker/issues/comments/126947527","html_url":"https://github.com/systemed/tilemaker/issues/13#issuecomment-126947527","issue_url":"https://api.github.com/repos/systemed/tilemaker/issues/13","id":126947527,"user":{"login":"AndreMiras","id":24973,"avatar_url":"https://avatars.githubusercontent.com/u/24973?v=3","gravatar_id":"","url":"https://api.github.com/users/AndreMiras","html_url":"https://github.com/AndreMiras","followers_url":"https://api.github.com/users/AndreMiras/followers","following_url":"https://api.github.com/users/AndreMiras/following{/other_user}","gists_url":"https://api.github.com/users/AndreMiras/gists{/gist_id}","starred_url":"https://api.github.com/users/AndreMiras/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AndreMiras/subscriptions","organizations_url":"https://api.github.com/users/AndreMiras/orgs","repos_url":"https://api.github.com/users/AndreMiras/repos","events_url":"https://api.github.com/users/AndreMiras/events{/privacy}","received_events_url":"https://api.github.com/users/AndreMiras/received_events","type":"User","site_admin":false},"created_at":"2015-08-01T19:20:16Z","updated_at":"2015-08-01T19:20:16Z","body":"Great, thank you for the hint!"}}