Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Feb 5, 2011, 02:59 PM   #1
Ste5442
macrumors newbie
 
Join Date: Feb 2011
Creating an empty mp3 or jpg of a specific size

Hi All,

I need to generate files of 250/500/1000MB for test purposes and they need gombe either jpg or mp3. I know how to create an empty file of specific size but a media app needs to be able to recognise the file as a jpg or mp3 so i guess it needs at least some header info in there?

If anyone can help it really would be appreciated!

Many thanks,

Steven.

PS: Had a look on google and some other forums but no answers :-(
Ste5442 is offline   0 Reply With Quote
Old Feb 5, 2011, 04:00 PM   #2
kainjow
Moderator emeritus
 
kainjow's Avatar
 
Join Date: Jun 2000
What do you mean by "empty"? For example you could create a huge jpeg (say converted from a raw image) but then manually set the width and height via a hex editor to 0. But whatever program you're using might check for this and classify it as an invalid image.

Can you be more specific on what you're trying to test?
kainjow is offline   0 Reply With Quote
Old Feb 5, 2011, 04:48 PM   #3
Sydde
macrumors 68000
 
Sydde's Avatar
 
Join Date: Aug 2009
You could just create a NSImage, set its rectangle, and write its bitmap imagerep to a file as a jpeg (if you know how to use Cocoa).
__________________
You got to be a spirit. You can't be no ghost.
Sydde is offline   0 Reply With Quote
Old Feb 5, 2011, 11:30 PM   #4
wlh99
macrumors 6502
 
Join Date: Feb 2008
250MB/500MB/or 1000MB is not empty. Do you need to create the file pragmatically, or just create them somehow to use as test data to test a program?

For the JPG, I would create a huge file new image in photoshop or a similar image editor, apply some noise filter so it won't compress easily, then set the dimensions of the image until I got the desired file size.

For the mp3, maybe just start recording in garage band and let is sit overnight? Or create a file with one of the included loops that is 24 or 48 hours long? Not sure as I don't use garage band.
__________________
Warren Holybee
wlh99 is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
thread Thread Starter Forum Replies Last Post
What's a good application to program and create an application with on OSX? rebello95 Mac Programming 3 Nov 9, 2011 07:12 AM
is there a way to create an applescript to auto-label files in a specific folder? steezy1337 Mac Programming 3 Oct 5, 2011 03:54 PM
MP3 or wav of iPhone "ALARM" horn g-boac iPhone 4 Mar 19, 2010 04:29 PM
Creating an empty non-zero kbytes text file Soulstorm Mac Programming 3 Apr 29, 2008 11:49 AM
Mac program that can create an image or ISO of CD Sean Dempsey Mac Applications and Mac App Store 7 Jul 15, 2007 06:35 AM


All times are GMT -5. The time now is 04:00 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC