Mercurial > hg > dmlib
comparison gfxconv.c @ 463:4204e9ea8ae1
Improve probing.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sun, 04 Nov 2012 16:35:38 +0200 |
parents | ab401a5087f9 |
children | ffd5e730d313 |
comparison
equal
deleted
inserted
replaced
462:ab401a5087f9 | 463:4204e9ea8ae1 |
---|---|
825 | 825 |
826 // Determine input format, if not specified' | 826 // Determine input format, if not specified' |
827 if (optInFormat == FFMT_AUTO && optInFilename != NULL) | 827 if (optInFormat == FFMT_AUTO && optInFilename != NULL) |
828 { | 828 { |
829 char *dext = strrchr(optInFilename, '.'); | 829 char *dext = strrchr(optInFilename, '.'); |
830 dmMsg(2, "Trying to determine file format by extension.\n"); | |
830 if (dext) | 831 if (dext) |
831 { | 832 { |
832 dmGetFormatByExt(dext + 1, &optInFormat, &optInSubFormat); | 833 dmGetFormatByExt(dext + 1, &optInFormat, &optInSubFormat); |
833 } | 834 } |
834 } | 835 } |
876 | 877 |
877 if (res == 0) | 878 if (res == 0) |
878 optInFormat = FFMT_BITMAP; | 879 optInFormat = FFMT_BITMAP; |
879 } | 880 } |
880 | 881 |
881 if (optInFormat == FFMT_AUTO) | 882 if (optInFormat == FFMT_AUTO || optInFormat == FFMT_IMAGE) |
882 { | 883 { |
883 DMImageFormat *ifmt = NULL; | 884 DMImageFormat *ifmt = NULL; |
884 int index; | 885 int index; |
886 dmMsg(2, "Trying to probe image formats.\n"); | |
885 if (dmImageProbeGeneric(dataBuf + optInSkip, dataSize - optInSkip, &ifmt, &index) > 0) | 887 if (dmImageProbeGeneric(dataBuf + optInSkip, dataSize - optInSkip, &ifmt, &index) > 0) |
886 { | 888 { |
887 optInFormat = FFMT_IMAGE; | 889 optInFormat = FFMT_IMAGE; |
888 optInSubFormat = index; | 890 optInSubFormat = index; |
891 dmMsg(2, "Probed %s format image.\n", ifmt->fext); | |
889 } | 892 } |
890 } | 893 } |
891 | 894 |
892 if (optInFormat == FFMT_AUTO) | 895 if (optInFormat == FFMT_AUTO) |
893 { | 896 { |