file-format

Is the 2nd and 3rd byte of a JPEG image always the APP0 or APP1 marker?

倖福魔咒の 提交于 2019-11-27 06:13:25
问题 I have a few different JPEG images I've been testing with. As far as I've seen the 0th and first bytes are always 0xFF and 0xD8 . The second and third are usually either 0xFF and 0xE0 ( APP0 ) indicating either a JFIF segment or JFIF extension segment or 0xFF and 0xE1 ( APP1 ) indicating an EXIF segment. My question: is this always the case? Are the 2nd and 3rd bytes always APP0 or APP1? 回答1: No. There are e.g. several cameras that create JPEGs without these markers, or with other APP markers

Git: Confusion about merge algorithm, conflict format, and interplay with mergetools

狂风中的少年 提交于 2019-11-27 06:04:24
问题 I don't know the details, but as far as I understand the process of merging and conflict resolution, it goes as follows (assume there is only one file in the repository, modified in two branches): The user issues a git merge command. Git applies some git-specific algorithm to automatically merge the two modified files. For this purpose it creates a BASE, LOCAL, OTHER and BACKUP version of the file. It then writes the merge result into the original tracked file (call it MERGED). Assume there

What is the BMP format for Gray scale Images?

白昼怎懂夜的黑 提交于 2019-11-27 03:55:01
问题 What is the BMP format for Gray scale Images (especially for 16 bit per pixel) ? The wikipedia just talks about colour images for bmp. Update: Just for an update and information for future visitors, I am going for PGM as this is uncompressed and can support 16 bit gray-scale. Another option was to use PNG, but it compresses the data (which is not what I want) as discussed here . Also note that the image may appear distorted, since most of the monitors support 256 colors and not 4096 for 16

Load Jpg/Gif/Bitmap and convert to Bitmap

天大地大妈咪最大 提交于 2019-11-27 03:42:05
I have to load an image from an XML file. There is no information in the XML file about whether the image is JPG/GIF/BMP. After loading the image, I need to convert it to Bitmap. Does anyone have any clue how to convert images to Bitmap without knowing the actual file format? I'm using Delphi 2007/2009 Thank you. Delphi 2009 comes with built in support for JPEG, BMP, GIF and PNG. For earlier versions of Delphi you may need to find third party implementations for PNG and GIF, but in Delphi 2009 you simply add the Jpeg , pngimage and GIFImg units to your uses clause. If the file has an extension

How can I determine if a file is an image file in .NET?

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-27 02:42:45
问题 I don't want to rely on the file extension. I don't care to know what type of image it is (.jpg, .png, etc.), I simply want to know if the file is an image or not. I'd prefer to not use any non-.NET dlls if possible. The best way I know how to do this is the following: bool isImageFile; try { Image.FromFile(imageFile).Dispose(); isImageFile = true; } catch (OutOfMemoryException) { isImageFile = false; } As noted here: http://msdn.microsoft.com/en-us/library/stf701f5.aspx, Image.FromFile()

Text file with 0D 0D 0A line breaks

蓝咒 提交于 2019-11-27 02:30:56
问题 A customer is sending me a .csv file where the line breaks are made up of the sequence 0xD 0xD 0xA . As far as I know line breaks are either 0xA from Mac or Unix or 0xD 0xA from Windows. Is the 0xD 0xD 0xA any known encoding? Is there any known sequence of savings that corrupts a file's line endings that causes this (I think the customer uses a Mac)? The file doesn't start with any encoding markers, it starts with the text contents directly. The text is displayed correctly if opened with code

Why am I getting mime-type of .csv file as “application/octet-stream”?

醉酒当歌 提交于 2019-11-27 01:40:26
I'm working on a PHP application that must import an excel file into MySQL. So I need to convert the excel file to .csv format. But when I want to get its type using $_FILE['something']['type'] , I get application/octet-stream as its mime-type; I think there is something wrong here. Because I gathered the list below as a .csv file mime-type: text/comma-separated-values, text/csv, application/csv, application/excel, application/vnd.ms-excel, application/vnd.msexcel What's the matter ? In times like these, the official HTTP specification is always helpful. From RFC 2616 7.2.1 (my emphasis added)

What is the format of a patch file?

房东的猫 提交于 2019-11-27 01:26:49
问题 What does the following mean ? diff -rBNu src.orig/java/org/apache/nutch/analysis/NutchAnalysisConstants.java src/java/org/apache/nutch/analysis/NutchAnalysisConstants.java --- src.orig/java/org/apache/nutch/analysis/NutchAnalysisConstants.java 2009-03-10 11:34:01.000000000 -0700 +++ src/java/org/apache/nutch/analysis/NutchAnalysisConstants.java 2009-03-10 14:11:55.000000000 -0700 @@ -4,9 +4,12 @@ + int CJK = 21; + int DIGIT = 22; int DEFAULT = 0; String[] tokenImage = { "<EOF>", + "\"OR\"",

“Best” Input File Formats for C++? [closed]

血红的双手。 提交于 2019-11-27 00:56:49
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 4 years ago . I am starting work on a new piece of software that will end up needing some robust and expandable file IO. There are a lot of formats out there. XML, JSON, INI, etc. However, there are always plusses and minuses so I thought I would ask for some community input. Here are some

What's Is the Best File Format for Configuration Files

时光怂恿深爱的人放手 提交于 2019-11-27 00:47:09
问题 I am creating a framework in PHP and need to have a few configuration files. Some of these files will unavoidably have a large number of entries. What format would be the best for these config files? Here is my quantification of best: Easily parsed by PHP. It would be nice if I didn't have to write any parsing code but this is not a deal breaker. Remains easily read by humans even when there are a large amount of entries Is a widely used standard, no custom formats Succinctness is appreciated