Welcome, Guest. Please login or register.

Author Topic: Unknown IFF Format / Help me please !!!  (Read 1659 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline maxmaniaTopic starter

  • Newbie
  • *
  • Join Date: Nov 2007
  • Posts: 2
    • Show only replies by maxmania
Unknown IFF Format / Help me please !!!
« on: November 10, 2007, 12:07:13 PM »
Hello everybody,

I want to convert some Amiga based IFF files to GIF, but the files seems unknown to then most convention programs under Windows .  

Please help me to convert the files .

http://rapidshare.com/files/68321925/SEBP_sheet1
http://rapidshare.com/files/68322101/SEBP_sheet2
http://rapidshare.com/files/68322262/SEBP_sheet3
http://rapidshare.com/files/68322508/SEBP_sheet4
http://rapidshare.com/files/68322634/SEBP_sheet5

Regards,
Alex
 

Offline Piru

  • \' union select name,pwd--
  • Hero Member
  • *****
  • Join Date: Aug 2002
  • Posts: 6946
    • Show only replies by Piru
    • http://www.iki.fi/sintonen/
Re: Unknown IFF Format / Help me please !!!
« Reply #1 on: November 10, 2007, 12:16:32 PM »
The files are corrupt (chunks are shifted when they should be aligned). The corruption is from converting \n linefeeds to \r\n.

This can be undone manually but it needs some work (there can be \r\n sequence naturally in a binary file, so one needs to be careful not just replace all \r\n to \n globally).

If you transferred the files using CrossDos, make sure you don't have the linefeed conversion enabled when moving binary files. Also some combination of bogus mimetypes and certain browsers are known to result in such corruption.
 

Offline Piru

  • \' union select name,pwd--
  • Hero Member
  • *****
  • Join Date: Aug 2002
  • Posts: 6946
    • Show only replies by Piru
    • http://www.iki.fi/sintonen/
Re: Unknown IFF Format / Help me please !!!
« Reply #2 on: November 10, 2007, 01:12:31 PM »
Ok, here we go:
Code: [Select]
/*
  fix file corrupted by \n -> \r\n conversion

  NOTE: This program will convert all \r\n combinations. If such
  sequence occured in the original file it will be removed aswell.

  Written by Harry Sintonen <sintonen@iki.fi>
  Public Domain
*/

#include <stdio.h>
#include <stdlib.h>
#ifdef MSDOS
#include <fcntl.h>
#include <io.h>
#endif

#define RINGSIZE 2
#define CURR(x) ((x) % RINGSIZE)
#define PREV(x) (((x) - 1) % RINGSIZE)
#define NEXT(x) PREV(x)

int main(void)
{
  int c;
  unsigned char ring[RINGSIZE];
  int rindex = 0, windex = 0;
#ifdef MSDOS
  setmode(fileno(stdin), O_BINARY);
  setmode(fileno(stdout), O_BINARY);
#endif
  while ((c = getchar()) != EOF)
  {
    ring[CURR(windex++)] = c;
    if (windex - rindex == 2)
    {
      if (ring[CURR(rindex)] == '\r' &&
          ring[NEXT(rindex)] == '\n')
      {
        /* Skip this char */
        rindex++;
        continue;
      }
      putchar(ring[CURR(rindex++)]);
    }
  }
  /* Process remaining chars */
  while (CURR(rindex) != CURR(windex))
  {
    if (windex - rindex == 2 &&
        ring[CURR(rindex)] == '\r' &&
        ring[NEXT(rindex)] == '\n')
    {
      /* Skip this char */
      rindex++;
      continue;
    }
    putchar(ring[CURR(rindex++)]);
  }

  return EXIT_SUCCESS;
}

Code: [Select]
$ gcc -Wall -O2 fixlf.c -o fixlf
$ ./fixlf < SEBP_sheet1 | ilbmtoppm -verbose | pnmtopng - > SEBP_sheet1.png
ilbmtoppm: dimensions: 640x512, 2 planes
ilbmtoppm: compression: byterun1
ilbmtoppm: warning - non-square pixels; to fix do a 'pnmscale -yscale 1.1'
ilbmtoppm: unknown chunk type DPPS - skipping
ilbmtoppm: warning - probably shifted 4-bit colormap
ilbmtoppm:     use "-adjustcolors" to scale colormap to 8 bits
ilbmtoppm: input is a 2-plane ILBM
pnmtopng: 3 colors found

And the result:
 

Offline Piru

  • \' union select name,pwd--
  • Hero Member
  • *****
  • Join Date: Aug 2002
  • Posts: 6946
    • Show only replies by Piru
    • http://www.iki.fi/sintonen/
Re: Unknown IFF Format / Help me please !!!
« Reply #3 on: November 10, 2007, 01:13:29 PM »
Here are the rest:



 

Offline maxmaniaTopic starter

  • Newbie
  • *
  • Join Date: Nov 2007
  • Posts: 2
    • Show only replies by maxmania
Re: Unknown IFF Format / Help me please !!!
« Reply #4 on: November 10, 2007, 09:09:57 PM »
Piru , Thank you very much my friend for convention of the files  and Technical Info.
I sent a private message to you , please read it.
 

Offline jmbattle

  • Sr. Member
  • ****
  • Join Date: May 2005
  • Posts: 324
    • Show only replies by jmbattle
    • http://www.amigainabox.co.uk
Re: Unknown IFF Format / Help me please !!!
« Reply #5 on: November 11, 2007, 12:41:27 AM »
What a lovely chap.

Take care,
James
x