Is it possible to resize images taken from media.show(media.Camera) in an app itself?

I could do with being able to resize images before they are uploaded to a server, so that people with a hi-res camera don’t have their data allowances eaten away by a few uploads.

Is there a way to save the image as a fixed size? [import]uid: 84115 topic_id: 31173 reply_id: 331173[/import]

I also need a lot to resize images but there is no such a feature in Corona.
If there will be a lot of people to request image resizing I think they will add it.
Feel free to send suggestions (or propositions) by contacting Corona via the below link.
http://www.coronalabs.com/about/contact/ [import]uid: 138389 topic_id: 31173 reply_id: 124690[/import]

One technique is to resize the image using the display… This limits your overall image size to the maximum display size though – but it does work.

This is a code excerpt, so you’ll have to work with the idea:

local function cameraDone(event)  
  
 print(" -- cameraDone(event) entered.")  
  
 if( event.target ~= nil ) then -- User took a photo...  
 t = event.target  
  
 local photot = display.newGroup()   
  
 print(" -- saving portarait mode")  
 t.width = mojoData.\_DeviceScreenCapWidth / 2 -- Adjust size  
 t.height = mojoData.\_DeviceScreenCapHeight / 2   
  
 photot:insert(t)  
 photot.x = 320   
 photot.y = 480  
 local baseDir = system.TemporaryDirectory  
  
 imageFilename = utils.getUniqueFilename()  
 imageFilename = imageFilename .. ".jpg"   
  
 display.save(photot, imageFilename, baseDir)   
  
 photot:removeSelf() -- Now get rid of it... (system puts it onscreen when group is created)  
 end  
end  

Good Luck! [import]uid: 79933 topic_id: 31173 reply_id: 124692[/import]

I also need a lot to resize images but there is no such a feature in Corona.
If there will be a lot of people to request image resizing I think they will add it.
Feel free to send suggestions (or propositions) by contacting Corona via the below link.
http://www.coronalabs.com/about/contact/ [import]uid: 138389 topic_id: 31173 reply_id: 124690[/import]

One technique is to resize the image using the display… This limits your overall image size to the maximum display size though – but it does work.

This is a code excerpt, so you’ll have to work with the idea:

local function cameraDone(event)  
  
 print(" -- cameraDone(event) entered.")  
  
 if( event.target ~= nil ) then -- User took a photo...  
 t = event.target  
  
 local photot = display.newGroup()   
  
 print(" -- saving portarait mode")  
 t.width = mojoData.\_DeviceScreenCapWidth / 2 -- Adjust size  
 t.height = mojoData.\_DeviceScreenCapHeight / 2   
  
 photot:insert(t)  
 photot.x = 320   
 photot.y = 480  
 local baseDir = system.TemporaryDirectory  
  
 imageFilename = utils.getUniqueFilename()  
 imageFilename = imageFilename .. ".jpg"   
  
 display.save(photot, imageFilename, baseDir)   
  
 photot:removeSelf() -- Now get rid of it... (system puts it onscreen when group is created)  
 end  
end  

Good Luck! [import]uid: 79933 topic_id: 31173 reply_id: 124692[/import]

@ mpappas
I’ve used your method and it’s perfect for what I need. Thanks. [import]uid: 84115 topic_id: 31173 reply_id: 128779[/import]

@ mpappas
I’ve used your method and it’s perfect for what I need. Thanks. [import]uid: 84115 topic_id: 31173 reply_id: 128779[/import]