timwaters / mapwarper

free open source public map georeferencer, georectifier and warper
http://mapwarper.net
MIT License
196 stars 80 forks source link

Grey JPG error (was Maximum size for image uploads) #125

Closed naomap closed 5 years ago

naomap commented 7 years ago

Hello. I uploaded a Cassini map (France, 1740) : http://mapwarper.net/maps/21097 However the image doesn't show up in the Show and Rectify tabs : all tiles show up as a broken image link. Looking at image loads in Firebug there doesn't seem to be any request for the tiles...

This is a rather large file (11811 x 8344 pixels, 29 Mb) which I downloaded from https://remonterletemps.ign.fr/ then converted from JP2 to JPG using https://convertio.co/fr/jp2-jpg/. Is there a maximum size, should I just expect some latency for large files to be processed, or am I missing something ?

Thanks, Antoine.

timwaters commented 7 years ago

Hi, 29 mb is on the small side really. Im not sure what happened with this map, but please try deleting the uploaded map (link in edit tab) and re-uploading.

if it doesnt work, it could be something to do with the jp2000 format and conversion, in which case try converting to png or seeing what the colour space is.

If that doesnt work, please attach the original image you uploaded here and I'll be able to see whats going on!

naomap commented 7 years ago

I tried with PNG format and got the same result. I tried with an extract (just below 10 MB) and it works fine : http://mapwarper.net/maps/21100 You can download the full JPG file from here : http://data.cartocite.fr/IGNF_SCAN_CASSINI_1-0__2009-07-07__Scan_CD11X131_86k_1783.jpg

timwaters commented 7 years ago

many thanks! I think this is may be encountering a bug with grey images. If thats the case you might be able to add more bands and / or change the colorspace of the image to rgb. I ran a gdalinfo on the file:

tim@armadillo:~$ gdalinfo IGNF_SCAN_CASSINI_1-0__2009-07-07__Scan_CD11X131_86k_1783.jpg 
Driver: JPEG/JPEG JFIF
Files: IGNF_SCAN_CASSINI_1-0__2009-07-07__Scan_CD11X131_86k_1783.jpg
Size is 11811, 8344
Coordinate System is `'
Corner Coordinates:
Upper Left  (    0.0,    0.0)
Lower Left  (    0.0, 8344.0)
Upper Right (11811.0,    0.0)
Lower Right (11811.0, 8344.0)
Center      ( 5905.5, 4172.0)
Band 1 Block=11811x1 Type=Byte, ColorInterp=Gray
  Overviews: 5906x4172, 2953x2086, 1477x1043
  Image Structure Metadata:
    COMPRESSION=JPEG

so it just has the one band - and it's also a jpeg

i will see if it's the same bug as before (which occured with 1 band tifs and grey scale gifs etc see past issues). But if you are in a hurry, adding more bands and changing the colorspace to color might do the trick.

naomap commented 7 years ago

No hurry at all ! Thanks for the quick feedback, Antoine.

timwaters commented 6 years ago

@naomap can you see if this still is failing? I deployed a fix a while back, but cannot download the file, linked above.

timwaters commented 5 years ago

I believe this is now fixed with the above commit. closing :+1: