[OpenLayers-Users] "progressive jpegs" as tiles not loading gracefully

Steve Guerrero guerrero.steve at gene.com
Fri Jun 19 13:13:52 EDT 2009


Steve Guerrero wrote:
> Hi all,
> 
> I am using openlayers to navigate large tiled microscopy images in 
> "progressive jpeg" format.  I'm using the TMS layer and my own getURL 
> function to retrieve tiles.
> 
> Progressive jpegs are the kind that first load a blocky/blurry low 
> resolution version of the image and then get progressively more detailed.
> 
> When I have a tiled image with smooth backgrounds and/or very little 
> image detail within the tiles (i.e. the jpegs are highly compressed, the 
> file sizes are pretty small), they load just fine.  But when I try a 
> tiled image with lots of small details (i.e. less compression, bigger 
> jpeg filesizes), they seem to be "stuck" either partially loaded (strips 
> of white empty space) or they are only loaded at low resolution 
> (blocky/blurry first pass of the progressive jpeg).
> 
> My question is, is there a way to force that the tile should be loaded 
> completely to its highest resolution (i.e. don't bother showing 
> intermediate resolutions, just wait until you have the full res jpeg). 
> Is this a timeout issue with tile loading?  Is there some way I can 
> instruct OpenLayers to spend more time loading each tile so that it 
> arrives complete?
> 
> Thanks,
> -sg
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
> 


I seem to have found a workaround to this problem.  When I first had 
this problem, I was serving up in my own getURL function, URLs that were 
direct links to the jpgs in question (e.g. http://blah.com/a.jpg).  I 
seem to have fixed the problem by instead serving up a CGI script that 
reads in the whole jpeg into memory first and then delivers it in one 
blast.  I think the problem has to do with the way the browser renders 
progressive jpegs, and that it uses the logic that if all the 
progressive jpeg arrives on time, it doesn't try to render intermediate 
resolutions.

-sg



More information about the Users mailing list