Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improper image header error #2

Open
doublej74 opened this issue Jun 2, 2017 · 3 comments
Open

improper image header error #2

doublej74 opened this issue Jun 2, 2017 · 3 comments

Comments

@doublej74
Copy link

screenshot

just running one of the examples. Am I missing something is the code broken?

@caiguanhao
Copy link
Owner

Possible reason for this error:

  • the convert command -- make sure you have installed ImageMagick correctly
  • the file system you're using -- PNG files was created without image headers

@doublej74
Copy link
Author

doublej74 commented Jul 11, 2017

I installed the latest version of ImageMagick on a simple debian 7 server. No rocket science. It just won't work with the latest version of ImageMagick. Which version of ImageMagick did you use originally?

Maybe the cause lies with baidu. When it starts downloading the tiles, sometimes empty png files pop up in the maps directory. When the map is generated (with the errors as the ones in the screenshot above) the done.png looks something like this:
test1

@caiguanhao
Copy link
Owner

I've tested the examples in the README.md on my Ubuntu 16.04 server and they worked as expected. Do you use Docker? You can use Docker image like this:

FROM alpine:edge
RUN apk add --no-cache bash imagemagick bc wget libpng-dev

Or run these commands one by one:

cd baidu-maps-download
docker run -it --rm -v="$PWD:/bmd" -w="/bmd" alpine:edge sh
apk add --no-cache bash imagemagick bc wget libpng-dev
bash center2pieces.sh 12616085.15, 2628677.18 15 web-alt 1000 1000 | xargs bash pieces2one.sh
exit
# now you should see the file done.png in the maps directory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants