Maybe people will appreciate this on a programming forum >_>
C# program + code to convert any file to a png and vice-versa. So anyone interested (or even wondering how to do that) can check it out (or even use it on 4chan to upload small files in place of rapidshare).
Why would you want do convert a lossy format to png?
Name:
Anonymous2006-10-05 4:48
Can you upload it somewhere else? My ISP isn't compatible with Rapidshare
Name:
Anonymous2006-10-05 5:23
Error: Unhandled Exception: System.TypeInitializationException: An exception was thrown by the type initializer for System.Drawing.GDIPlus ---> System.DllNotFoundException: gdiplus.dll in (wrapper managed-to-native) System.Drawing.GDIPlus:GdiplusStartup (ulong&,System.Drawing.GdiplusStartupInput&,System.Drawing.GdiplusStartupOutput&) in <0x000fa> System.Drawing.GDIPlus:.cctor ()--- End of inner exception stack trace ---
in <0x00000> <unknown method> in <0x0002f> System.Drawing.Bitmap:.ctor (Int32 width, Int32 height, PixelFormat format) in <0x00015> System.Drawing.Bitmap:.ctor (Int32 width, Int32 height) in (wrapper remoting-invoke-with-check) System.Drawing.Bitmap:.ctor (int,int) in <0x00057> hotaru.Program:TranscodeData (System.IO.FileStream fs, Int32 x, Int32 y) in <0x000e9> hotaru.Program:EncodeProcess (System.IO.FileInfo file) in <0x0002f> hotaru.Program:.ctor (System.IO.FileInfo file, Boolean encode, Int64 length) in <0x00167> hotaru.Program:Main (System.String[] args)
You misunderstand. It encodes any arbitrary data as a PNG.
Name:
Anonymous2006-10-05 6:17
OP here,
>>4
mono hates it... So, not much that can be done there... The Drawing class doesn't seem to be complete =.= Hate to break that news to you.
To address >>2
You can convert ANY file at all to png. So say you have a zip, and you wish to "hide" it; it'll look like a bunch of static. (You can also therefore post any file on 4chan as long as it's within the size limit).
Also there's an error I noticed in the code. At line 50, within the try block, both of those if statements should have an else that throws an exception. ("else throw new Exception();") That's just so it handles the file naming properly. Otherwise, if you rename the file and still try to decocde it, you might get a null pointer exception.
>>18
Is also the PC of choice for homosexual males.
Name:
Anonymous2006-10-07 4:13
HI I'M A MAC I WEAR 'HIP' CLOTHES AND LOOK SMUG. OH YEAH I'M UNEMPLOYED BECAUSE JOBS ARE FOR LOSERS. HAHA LOOK AT THAT DUMB PC HE'S ALL MIDDLE AGED AND WEARING A SUIT WHAT A LOSER HAHA.