[HN Gopher] Biggest image in the smallest space (2011)
       ___________________________________________________________________
        
       Biggest image in the smallest space (2011)
        
       Author : stefankuehnel
       Score  : 20 points
       Date   : 2023-10-27 12:55 UTC (1 days ago)
        
 (HTM) web link (www.bamsoftware.com)
 (TXT) w3m dump (www.bamsoftware.com)
        
       | hinkley wrote:
       | Questions like this come in pretty handy for test fixtures.
       | 
       | Sometimes you worry about the memory usage of a file to be
       | processed, rather than the disk usage. If you can make a fixture
       | that is substantially smaller on the outside, you can just check
       | it into version control instead of having to fiddle with
       | generating them or storing them in some external store, where
       | they tend to rot.
       | 
       | What does our code signing library do with 2,4,20GB compressed
       | files? What does our image upload tool do if you give it a 50
       | megapixel picture of blue sky? What if our customer is just
       | trying to be an asshole? All good integration tests to run.
        
         | kadoban wrote:
         | > If you can make a fixture that is substantially smaller on
         | the outside, you can just check it into version control instead
         | of having to fiddle with generating them or storing them in
         | some external store, where they tend to rot.
         | 
         | You _can_ check fairly large files into version control without
         | any real issues, especially if you're aware of the limitations.
         | 
         | For example, in git, if you have a 20GB file that never (or
         | rarely) changes, it'll work great. The only real reason to
         | avoid that would be if most people who clone the repo won't
         | need that file, or if your repo host (eg github) gets mad.
         | 
         | There's certainly times you'd want to avoid it and find other
         | solutions, but it should be a tool in the box when needed IMO,
         | and a lot of people just don't even consider it.
        
       | logicallee wrote:
       | On the subject of large images in small spaces, mobile safari has
       | a problem displaying large images.
       | 
       | I have a 2311x813 image, the version I serve to iOS devices is
       | just 240 kilobytes.
       | 
       | But I can't get my iPhone 13 to handle it in a canvas correctly,
       | I put it in a container so the user can drag and zoom it. I added
       | scroll to zoom and click to drag for desktop, and pinch to zoom
       | on mobile.
       | 
       | On iPhone it randomly disappears as it is being moved around.
       | 
       | You can try it in the bottom of this page:
       | 
       | https://taonexus.com/publicfiles/october2023/engagement-anno...
       | 
       | On Desktop Chrome, Firefox and Edge it is flawless, on mobile
       | Chrome also flawless on Android, but on iOS both Safari and
       | Chrome (which uses webkit) have a problem where as you keep
       | panning around and zooming the image, it starts disappearing
       | (after a few seconds of moving it around; at first it starts out
       | okay.)
       | 
       | This shows that browsers are not necessarily great at handling
       | even quite reasonably sized images.
        
       ___________________________________________________________________
       (page generated 2023-10-28 23:00 UTC)