Announcement

Collapse
No announcement yet.

Showing gif-files in PB

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Showing gif-files in PB

    What is the best way to show a gif-file in PB?

    Should I first converte the gif-file to bmp?

    If so: how do I do that? (OpenIL can't do it, and I don't thing
    ImgSource can do it)

    Regards
    Peter

    ------------------
    [email protected]
    www.dreammodel.dk

  • #2
    ISource (and the older IMGDLL) do not support GIF files since www.smalleranimals.com got a legal opinion that they would have to obtain an expensive license from Unisys. They have (had?) an FAQ on this on their site explaining the reasons in detail.

    Basically, as I understand it, if your code uses the Unisys patented GIF algorithm then you need a license from Unisys ($$$). If you sell the program, the user *may* have to buy a license from Unisys to use it legally ($$$). If you use GIF images on your web site, you also may be in breach of Patent rights.

    There are alternative GIF formats that do not use the Unisys algorithm, but I'd personally rather use an alternative image format, such as PNG, which was created in response to the Unisys debacle. PNG is supported by almost all image libraries and browsers these days.

    Anyway, if you still want to pursue GIF, you should be able to find some code on the web. There was some DOS code at www.basicguru.com/abc - maybe that will help you? Also see http://www.powerbasic.com/files/pub/...cs/GIFUNIT.ZIP

    Oh yeah... apparently posting/hosting source code that uses the Unisys algorithm is not a problem... actually using the code is.

    Disclaimer: I'm not a lawyer. From the stories I've heard, Unisys will likely tell you that: (a) "of course you must purchase a license!" or (b) "the license says what it says, and you must decide for yourself whether you are in complance", etc.

    ------------------
    Lance
    PowerBASIC Support
    mailto:[email protected][email protected]</A>
    Lance
    mailto:[email protected]

    Comment


    • #3
      Thank you Lance,

      The problem is that I'm working on a project where the user
      supplies the graphics, and my program shows it. I would
      like to support as many formats as possible. OpenIL can (for free)
      do the job for me, except for gif's.

      I do not need to make gif-files. I just need a gif-bmp conversion
      in memory.

      Regards
      Peter

      ------------------


      [This message has been edited by Peter P Stephensen (edited May 07, 2001).]
      [email protected]
      www.dreammodel.dk

      Comment


      • #4
        Peter,

        I did a gif reader/writer in VB a while back, there were a lot of tricks involved in getting the performance to a respectable level with regard to the LZW compression algorithm and using unions in the API colour mappings will boost performance over what VB could ever do.

        Lance is right about the patent by unisys, but it only covers commercial applications so I can give you a hand and what you do with it is your business

        I have quite a few tutorials etc from around the net on gif87a and some docs on later versions too that supported animated gifs but I didn't ever implement them. Email me at [email protected] or [email protected] .

        Writing the code is not against the patent, selling it could get you into trouble but there are apparently ways of decodeing GIF without LZW thus not infringing the patent. The details are in my Data Compression book so I can look them up if you care (I never really did to be honest)



        ------------------
        Paul Dwyer
        Network Engineer
        Aussie in Tokyo

        Comment


        • #5
          From the info I've been passed, the license is not "limited to" commercial applications. Even just including code that reads and converts a GIF using Unisys's algorithm can fall foul of their patent rights.

          As I noted, GIF files are a hassle. I would avoid them like the palgue. If you support the non-patent-GIF formats, you'll get users asking you how come your software works with only some GIF's... ugh!

          Sorry for being a scaremounger, but it's "better to be safe than in court".

          ------------------
          Lance
          PowerBASIC Support
          mailto:[email protected][email protected]</A>
          Lance
          mailto:[email protected]

          Comment


          • #6
            The best gif handler for windows (that I know of) is Gifsicle.
            A windows version is here: http://vrml3d.com/open
            There is also a version without LZW compression.

            Official homepage: http://www.lcdf.org/gifsicle/

            The source code is in C.
            Maybe you can extract gif reading code?

            BTW:
            I do not believe that Unisys patent (LZW) is valid in Denmark.
            So if App is for DK use, you sould be fine.
            Disclaimer: I am Not A Lawyer.



            ------------------
            Best Regards
            Peter Scheutz
            Best Regards
            Peter Scheutz

            Comment


            • #7
              I talked to a guy that worked at Unisys when I worked right next door to them...
              THey don't seem to like Shareware authors or anything and they just want the $$$...
              Considering not as many people use them, I wouldn't pay what they want...
              Seems, and dont' quote me, it was a couple hundred bucks for minimal use but I forget, I'd check with their legal dept or sales dept...

              Do be careful though, they are not too kin to people using their format without paying.


              Scott

              ------------------
              Scott
              Scott Turchin
              MCSE, MCP+I
              http://www.tngbbs.com
              ----------------------
              True Karate-do is this: that in daily life, one's mind and body be trained and developed in a spirit of humility; and that in critical times, one be devoted utterly to the cause of justice. -Gichin Funakoshi

              Comment


              • #8
                Basically, as I understand it, if your code uses the Unisys patented GIF algorithm then you need a license from Unisys ($$$). If you sell the program, the user *may* have to buy a license from Unisys to use it legally ($$$). If you use GIF images on your web site, you also may be in breach of Patent rights.
                This issue is covered in Microsoft KB article #Q193543.
                If you try to make something idiot-proof, someone will invent a better idiot.

                Comment


                • #9
                  Or ask them...
                  http://www.unisys.com/unisys/lzw/

                  One point I agree with Lance on is that there are better formats, Gif is only capable of 256 colours anyway so you're better of with jpg.



                  ------------------
                  Paul Dwyer
                  Network Engineer
                  Aussie in Tokyo

                  Comment

                  Working...
                  X