file-format

File format limits in pixel size for png images?

女生的网名这么多〃 提交于 2019-12-04 00:42:16
问题 Is there a file format limit to the PNG pixel size? I am trying to visualize a 30.000x30.000 pixels PNG image with Firefox, but I get an error. The image opens correcly in Preview.app, although very slowly. The file size is not big, just around 3 MiB (1 bit black/white image). I am wondering if there's a technical file-format reason for this. 回答1: A naive implementation of resizing would require the image to be blown up to 2.7GB in size before it is displayed. This would clearly be too large

Is it legal to reverse engineer binary file formats [closed]

蓝咒 提交于 2019-12-04 00:03:54
Is it legal to add support for a 3rd party file format in my application by reverse engineer a unencrypted binary file format from another application, and reading the contents? Depends on your location. In the EU it is specifically permitted (article 6 EU software convention) to "reverse engineer file formats for the purpose of interoperability" In general it's hard to prevent someone reading a file format, there have been examples where you are prohibeted from writing a file because the format contains patented technology (if software patents are allowed in your country). This was the case

How to convert any format(.txt, .Doc) file into epub file in android application

老子叫甜甜 提交于 2019-12-03 21:47:30
I am developing an application in which I have to read or write any eBook. In android so many libraries available for reading any eBook, but for writing i didn't find any thing. For reading any eBook file must be in .epub format. I have an editor in which i am entering some text and after saving that file in any format how can i convert that file into .epub file. Thanks in advance. In android Java is developer language for create APP, use Epublib (lib in java) Read "doc file" with poi Create epub file: package nl.siegmann.epublib.examples; import java.io.InputStream; import java.io

reading middlebury 'flow' files with python (bytes array & numpy)

a 夏天 提交于 2019-12-03 21:37:51
I'm trying to read a .flo file as a numpy 2Channels image. The format is described like this: ".flo" file format used for optical flow evaluation Stores 2-band float image for horizontal (u) and vertical (v) flow components. Floats are stored in little-endian order. A flow value is considered "unknown" if either |u| or |v| is greater than 1e9. bytes contents 0-3 tag: "PIEH" in ASCII, which in little endian happens to be the float 202021.25 (just a sanity check that floats are represented correctly) 4-7 width as an integer 8-11 height as an integer 12-end data (width*height*2*4 bytes total) the

How to get the length of a file in MATLAB?

假如想象 提交于 2019-12-03 21:19:46
问题 Is there any way to figure out the length of a .dat file (in terms of rows) without loading the file into the workspace? 回答1: Row Counter -- only loads one character per row: Nrows = numel(textread('mydata.txt','%1c%*[^\n]')) or file length (Matlab): datfileh = fopen(fullfile(path, filename)); fseek(datfileh, 0,'eof'); filelength = ftell(datfileh); fclose(datfileh); 回答2: I'm assuming you are working with text files, since you mentioned finding the number of rows. Here's one solution: fid =

Tips on how to parse custom file format

强颜欢笑 提交于 2019-12-03 20:19:29
Sorry about the vague title, but I really don't know how to describe this problem concisely. I've created a (more or less) simple domain-specific language that I will to use to specify what validation rules to apply to different entities (generally forms submitted from a web page). I've included a sample at the bottom of this post of what the language looks like. My problem is that I have no idea how to begin parsing this language into a form I can use (I will be using Python to do the parsing). My goal is to end up with a list of rules/filters (as strings, including arguments, e.g. 'cocoa(99)

Book translation data format

流过昼夜 提交于 2019-12-03 16:56:05
I'm thinking of translating a book from English to my native language. I can translate just fine, and I'm happy with vim as a text editor. My problem is that I'd like to somehow preserve the semantics, i.e. which parts of my translation correspond to the original. I could basically create a simple XML-based markup language, that'd look something like <book> <chapter> <paragraph> <sentence> <original>This is an example sentence.</original> <translation lang="fi">Tämä on esimerkkilause.</translation> </sentence> </paragraph> </chapter> </book> Now, that would probably have its benefits but I don

Hadoop ORC file - How it works - How to fetch metadata

佐手、 提交于 2019-12-03 15:48:34
I am new to ORC file. I went through many blogs, but didn't get clear understanding. Please help and clarify below questions. Can I fetch schema from ORC file? I know in Avro, schema can fetched. How it actually provides schema evolution? I know that few columns can be added. But how to do it. The only I know, creating orc file is by loading data into hive table which store data in orc format. How ORC files index works? What I know is for every stripe index will be maintained. But as file is not sorted how it helps looking up data in list of stripes. How it helps in skipping stripes while

Will random data appended to a JPG make it unusable?

余生长醉 提交于 2019-12-03 10:46:38
So, to simplify my life I want to be able to append from 1 to 7 additional characters on the end of some jpg images my program is processing*. These are dummy padding (fillers, etc - probably all 0x00) just to make the file size a multiple of 8 bytes for block encryption. Having tried this out with a few programs, it appears they are fine with the additional characters, which occur after the FF D9 that specifies the end of the image - so it appears that the file format is well defined enough that the 'corruption' I'm adding at the end shouldn't matter. I can always post process the files later

How do I choose a good magic number for my file format?

大憨熊 提交于 2019-12-03 10:29:39
I am designing a binary file format from scratch, and I would like to include some magic bytes at the beginning so that it can be identified easily. How do I go about choosing which bytes? I am not aware of any central registry of magic numbers, so is it just a matter of picking something fairly random that isn't already identified by, say, the file command on a nearby UNIX box? Stay away from super-short magic numbers. Just because you're designing a binary format doesn't mean you can't use a text string for identifier. Follow that by an EOF char, and as an added bonus people who cat or type