Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

FILE<->PNG Converter

Name: Anonymous 2006-10-05 1:52

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).

http://rapidshare.de/files/35548014/hotaru.zip.html

Name: Anonymous 2006-10-05 4:10

Why would you want do convert a lossy format to png?

Name: Anonymous 2006-10-05 4:48

Can you upload it somewhere else? My ISP isn't compatible with Rapidshare

Name: Anonymous 2006-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)

how do i fixed?

Name: Anonymous 2006-10-05 6:07

>>2

You misunderstand. It encodes any arbitrary data as a PNG.

Name: Anonymous 2006-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.

>>3
Uploaded here:
http://www.megaupload.com/?d=WF3MZA1D (this is also v2 with the code update)

Name: Anonymous 2006-10-05 6:20

OP again,
Here's the example I had earlier on how it works. Uploaded it to imageshack.

http://img220.imageshack.us/img220/3884/hotaruexamplebc7.jpg

(This also means you can convert a zip to png and upload it to imageshack to share as long as it's < 1.5 mb.)

Name: Anonymous 2006-10-05 6:38

sux

Name: Anonymous 2006-10-05 8:18

>>4
Install libgdiplus then complain to whoever didn't include it in the package or dependencies list.

Name: Anonymous 2006-10-05 9:05

If you're using a mac,

right click on the file, rename, '_______.png'.

Name: Mac pro user 2006-10-05 14:00

>>10
What is a "right cilck"?

Name: Anonymous 2006-10-05 15:00

>>11

If you're going to quote something, quote it properly you stupid imbecile.

Name: Anonymous 2006-10-05 16:22 (sage)

>>10
That's not how you rename things on a Mac

Name: Anonymous 2006-10-05 16:45 (sage)

>>13
i think he was thinking the mac users would be too stupid to figure that out.

Name: Anonymous 2006-10-06 1:36

>>12
Okay, sorry,  here you go: ``right cilck''

Name: Anonymous 2006-10-06 9:02

>>11,12,15
same person

Name: Anonymous 2006-10-06 10:49

Macs are for people with 2 hands. Not cripples with 1 hand.

Name: Anonymous 2006-10-06 11:14

Macs are for faggots
fixed

Name: Anonymous 2006-10-06 13:24

>>18
Also for computer illiterates and retards

Name: Anonymous 2006-10-07 3:43

>>18
Is also the PC of choice for homosexual males.

Name: Anonymous 2006-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.

Name: Anonymous 2006-10-07 11:25

>>18
>>19
>>20
>>21
Truth-in-a-row

Name: Anonymous 2006-10-07 17:11

I'm an unemployed loser lurking 4chan and I'm jealous that other people have more money than me.

Name: Anonymous 2006-10-08 0:25

hey guys, let's call faggots macsexuals. it'll be hilarious because it will piss off mac users, faggots, and elite grammarians, all at the same time.

Name: Anonymous 2006-10-08 11:32

I'm a GNAA/Linux user, but MAC is A-OK. I like the 'F9' button, it does neat stuff.

Name: Anonymous 2006-10-11 13:13

GNAA sucks all they do is troll and crap flood every board they can get their hands on. Timecop is a faggot too.

Name: Anonymous 2006-10-11 15:50

I was having trouble compiling it on linux, but it seems to run just fine on mono after being compiled in VS.NET.

Name: Anonymous 2006-10-15 14:49

poo

Name: Anonymous 2009-01-14 14:42

YES

Name: ​​​​​​​​​​ 2010-10-23 19:51

Name: Anonymous 2010-11-15 3:46

Name: Anonymous 2011-02-04 19:01

Name: Anonymous 2011-02-18 13:32

check 'em

Name: Sgt.Kabu褣烩kimanὈ㐀 2012-05-28 20:22

Bringing /prog/ back to its people
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy

Don't change these.
Name: Email:
Entire Thread Thread List