Menu

How Small Can You Go ?

2007-11-05
2013-05-02
  • Ciaran Clissmann

    Hi again,

    I'm trying to get the python system to zoomify small TIF images (50 k in size).

    What happens is that the system creates a directory,and a TileGroup0, but this TileGroup0 is empty and there is no xml file.

    I've tinkered with the ZoomifyBase.py, here's my current settings. If I set tilesize small enough I can force the creation of loads of TileGroup directories, bu they're all empty and there's no XML.

    _v_imageFilename = ''
      format = ''
      originalWidth = 0
      originalHeight = 0
      _v_scaleInfo = []
      numberOfTiles = 0
      _v_tileGroupMappings = {}
    #  qualitySetting = 80
      qualitySetting = 50
      tileSize = 256
    # tileSize = 512

    Can you advise as to the right settings to get the system to work with small files ? The files are about 2500x2000 pixels.

    Thanks a lot!

    Ciaran

     
    • adam smith

      adam smith - 2007-11-05

      Well, as you might suspect, I think it *should* work, and it should work with the default settings. Would you be able to email the image in question to me at asmith@agile-software.com? Also, let me know your urgency to solve it, and I will do my best to diagnose it in time. Other things like Python and PIL versions might also be helpful.

      Thanks,
      adam

       
    • adam smith

      adam smith - 2007-11-06

      Ciaran,

      Thanks for sending the images offline, that always helps.

      I apologize in advance, because I am probably going to be covering ground here that you already have, but I want to be sure to rule obvious things out.

      I am using Ubuntu Gutsy, with Python 2.5.1, and PIL 1.1.6-1 and this is what I get when I try ZoomifyFileProcessor on one of your images:

      Traceback (most recent call last):
        File "ZoomifyFileProcessor.py", line 129, in <module>
          processor.ZoomifyProcess(sys.argv[1:])
        File "ZoomifyFileProcessor.py", line 122, in ZoomifyProcess
          self.processImage()
        File "/home/ajs17/workspace/ZoomifyImage/ZoomifyBase.py", line 199, in processImage
          imageRow = image.crop([0, ul_y, self.originalWidth, lr_y])
        File "/usr/lib/python2.5/site-packages/PIL/Image.py", line 737, in crop
          self.load()
        File "/usr/lib/python2.5/site-packages/PIL/ImageFile.py", line 180, in load
          d = Image._getdecoder(self.mode, d, a, self.decoderconfig)
        File "/usr/lib/python2.5/site-packages/PIL/Image.py", line 375, in _getdecoder
          raise IOError("decoder %s not available" % decoder_name)
      IOError: decoder group4 not available

      This, despite the fact that I have libtiff installed also, and so, would not expect any issues. It looks like group4 support in PIL is somewhat sketchy, at least in the past, I Googled and see even recent posts (earlier this year) where people are applying patches to PIL versions 1.1.4 and 1.1.6 for group 4 tiff support. (I guess that shows how much I deal with tiffs.) For example:
        http://www.wiredfool.com/2007/03/13/compiling-pil-with-the-g4-tiff-patch-encore/

      Does any of this ring a bell? Also, are you on linux/unix or Windows?

      Otherwise, I can't imagine that the file size or dimensions being too small would create a problem. I have used Zoomify on some fairly low res camera images for example, probably in the range of your sample images, so I think something else is going on, and it may be a somewhat subtle bug somewhere.

      adam

       
      • Ciaran Clissmann

        Hi Adam

        thanks for the rapid response.

        I'm running under Windows XP, though my production environment is Linux - this hasn't been an issue to now. My production environment also refuses to handle very small TIFFs.

        I'm a bit out of my depth here - what you're suggesting is that the TIFF coverage in PIL is a bit flaky ? The wiredfool link you quote seems pretty Mac-centric, and lost me after a line or two, I must confess.

        Things I can do now (correct me or add others if you have ideas!)
        - convert all my TIFFs to Jpeg, or simply increase them in size, using imagemagick or Paintshop batching, this steps around the issue and I've tested that it works. Seems ugly, though.
        - get a new version of PIL, or a patch I can get my head around, and install, and hope for the best.
        - I could also ditch PIL and go with the PHP port of the system, but it's very unix-centric and would involve breaking code that's been working quite happily for a while...

        The overall conclusion is simply "don't use small TIFs with this system" ? That's better than no result, at least!

        thanks again

        Ciaran

         
        • adam smith

          adam smith - 2007-11-06

          OK, let me try this on a Windows machine, although I may not be able to do that right away, so if you've got a workaround that works, you probably want to go with that on your schedule. I'll update this thread as soon as I get a chance to investigate this more.

          So when you run it, it just silently fails right? You don't see any exception output?

           
    • adam smith

      adam smith - 2007-11-10

      Ciaran,

      I just tried processing your files on a Windows XP machine, with Python 2.5.1 and PIL 1.1.6 and got an identical "decoder group4 not available" exception. I assume this is what you are also seeing? If that's the case, then employing your workaround is probably the best option in the near future.

      adam

       

Log in to post a comment.