Image Resizer and Uploader

I am new to Flex, and I have (so far) only developed two
other applications using Flex.
I am having a really difficult time with this issue. I've
tried everything (except for creating a class) that I can think of
to resolve this issue, and I'm running out of ideas.
What I am trying to do is create an AIR application that
takes the selected images and resizes them to a specified maximum
height and width. It is resizing the image and saving it in a
temporary spot, but it will not upload after it saves it. I keep
receiving the error below:
quote:
Error #2044: Unhandled IOErrorEvent:. text=Error #2038: File
I/O Error.
at flash.filesystem::File/resolveComponents()
at flash.filesystem::File/resolvePath()
at ImageUploader/saveAndUploadImage()[C:\Documents and
Settings\jgosselin\workspace\ImageUploader\src\ImageUploader.mxml:136]
at ImageUploader/uploadButton_click()[C:\Documents and
Settings\jgosselin\workspace\ImageUploader\src\ImageUploader.mxml:50]
at ImageUploader/__uploadButton_click()[C:\Documents and
Settings\jgosselin\workspace\ImageUploader\src\ImageUploader.mxml:213]
My guess is that there is a lock on the file while it is
being written and it tries to upload it before it closes. However,
(as shown in the code) that is not the case. The error references
to lines that has nothing to do with the line of code that is
causing the issue. I have stepped through the code and it stops
after the FileStream close event handler has been executed. What am
I missing? What is it that I am not seeing? Has anyone developed
something similar to this application? As shown in the code, I am
using a series of events that triggers the next step of the
process.
EDIT: The code below is a scaled-down version of the
application.

Here is the code:
quote:
<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication xmlns:mx="
http://www.adobe.com/2006/mxml"
xmlns:local="SmoothImage.as" layout="vertical" horizontalGap="0"
verticalGap="0" paddingLeft="8" paddingRight="8" paddingTop="8"
paddingBottom="8" width="640" height="480" xmlns:local1="*">
<mx:Script>
<![CDATA[
import flash.events.OutputProgressEvent;
import flash.events.ProgressEvent;
import flash.filesystem.File;
import flash.filesystem.FileStream;
import flash.net.FileReference;
import flash.net.URLRequest;
import mx.collections.ArrayCollection;
import mx.controls.Alert;
import mx.graphics.codec.JPEGEncoder;
[Bindable] private var filesFiltered:Array;
private var maxImageWidth:Number = 640;
private var maxImageHeight:Number = 480;
private var tempFile:Array;
private var currentFile:Number;
private function uploadButton_click(event:Event):void
tempFile = fileThumb.selectedItems;
currentFile = 0;
saveAndUploadImage(tempFile[currentFile]);
private function
uploadFile_progress(event:ProgressEvent):void
var bytesUploaded:Number = event.bytesLoaded;
var bytesTotal:Number = event.bytesTotal;
uploadProgress.setProgress(bytesUploaded, bytesTotal);
uploadProgress.label = "Uploaded: " +
Math.round((bytesUploaded / bytesTotal) * 100) + "%";
private function uploadFile_complete(event:Event):void
uploadProgress.setProgress(0, 1);
uploadProgress.label = "";
if (currentFile + 1 < tempFile.length)
currentFile++;
saveAndUploadImage(tempFile[currentFile]);
private function
newFileStream_progress(event:OutputProgressEvent):void
var bytesPending:Number = event.bytesPending;
var bytesTotal:Number = event.bytesTotal;
var percentage:Number = Math.round(100 - ((bytesPending /
bytesTotal) * 100));
uploadProgress.setProgress(percentage, 100);
uploadProgress.label = "Writing: " + percentage + "%";
if (bytesPending == 0) { event.target.close(); }
private function newFileStream_close(event:Event):void
var uploadURL:URLRequest = new URLRequest("
http://localhost:8080/customers/propertypanorama_com/fileupload.php");
var uploadFile:FileReference =
FileReference(tempFile[currentFile]);
uploadFile.addEventListener(ProgressEvent.PROGRESS,
uploadFile_progress);
uploadFile.addEventListener(Event.COMPLETE,
uploadFile_complete);
uploadFile.upload(uploadURL, "uploadFile");
uploadProgress.setProgress(0, 1);
uploadProgress.label = "";
private function loader_complete(event:Event):void
var loader:Loader = Loader(event.target.loader);
var originalWidth:Number = event.target.width;
var originalHeight:Number = event.target.height;
var originalBitmap:BitmapData = new
BitmapData(originalWidth, originalHeight, false, 0x000000);
originalBitmap.draw(loader.content, null, null, null, null,
true);
var newImage:BitmapData = resizeImage(originalBitmap);
var newFileStream:FileStream = new FileStream();
newFileStream.addEventListener(OutputProgressEvent.OUTPUT_PROGRESS,
newFileStream_progress);
newFileStream.addEventListener(Event.CLOSE,
newFileStream_close);
newFileStream.openAsync(tempFile[currentFile],
FileMode.WRITE);
var jpgEncode:JPEGEncoder = new JPEGEncoder();
var writeData:ByteArray = jpgEncode.encode(newImage);
newFileStream.writeBytes(writeData, 0, writeData.length);
private function saveAndUploadImage(originalImage:File):void
var fromOldExt:String = originalImage.name;
var toJPG:String;
if (originalImage.extension.length == 4)
toJPG = fromOldExt.substring(0, fromOldExt.length - 4) +
"jpg";
else
toJPG = fromOldExt.substring(0, fromOldExt.length - 3) +
"jpg";
tempFile[currentFile] =
File.applicationStorageDirectory.resolvePath(toJPG);
var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE,
loader_complete);
loader.load(new URLRequest(originalImage.nativePath));
private function
resizeImage(originalImage:BitmapData):BitmapData
var originalWidth:Number = originalImage.width;
var originalHeight:Number = originalImage.height;
var doResize:Boolean = false;
var scaleRatio:Number = 1;
var newImageMatrix:Matrix;
var newImage:BitmapData;
var newWidth:Number = 0;
var newHeight:Number = 0;
doResize = (originalWidth > maxImageWidth ||
originalHeight > maxImageHeight);
if (doResize)
if (originalWidth > maxImageWidth)
scaleRatio = maxImageWidth / originalWidth;
newWidth = originalWidth * scaleRatio;
newHeight = originalHeight * scaleRatio;
else
scaleRatio = maxImageHeight / originalHeight;
newWidth = originalWidth * scaleRatio;
newHeight = originalHeight * scaleRatio;
newImageMatrix = new Matrix();
newImageMatrix.scale(scaleRatio, scaleRatio);
newImage = new BitmapData(newWidth, newHeight, false,
0x000000);
newImage.draw(originalImage, newImageMatrix, null, null,
null, true);
newImageMatrix = null;
return newImage;
else
return originalImage;
]]>
</mx:Script>
<mx:HBox width="100%" horizontalAlign="right"
paddingLeft="2" paddingRight="2" paddingTop="2" paddingBottom="2"
verticalAlign="middle">
<mx:ProgressBar id="uploadProgress" label="" width="100%"
/>
<mx:Button id="uploadButton" label="Upload"
click="uploadButton_click(event);" />
</mx:HBox>
</mx:WindowedApplication>

Similar Messages

  • PHP -Mysql image resize and upload

    All,
    Any good ideas, code out there to help me do a PHP MySQL image resize, uploade and display? Thanks for your help!

    For upload image, u may look at the similar thread HERE

  • Local image resize and upload

    Hi guys,
    I've been checking around the net for a way to implement the following:
    user wants to upload a large image. the image is resized locally on their computer to a 60kb small image. this image is then uploaded and used.
    Is there a way to do this with flash? or what is the best method? (NB: I'm not interested in using Java)
    thanks for any info or links.
    Jeff

    Well in short, you need a second language to support that,
    e.g. PHP/ASP/CF.
    First you'll have to build a GUi in which you can upload the
    jpg, putting it to the server using php/asp/cf, then you'll need to
    make a call to that image, (importing it into your flex), then
    you'll have to set the parameters for the resizing, then you'll
    have to call a php/asp/cf script which does te resizing

  • Image resizing and cropping

    Hi,
    I want to convert images to thumbnails with a 'standard' format - I need all images to have the same width and height.
    So I need to resize and then crop the images. Is this possibe with JAI? Are there other libraries which can do this better?
    I've read about ImageMagick - are the Java interfaces to ImageMagick good?
    /regards, Håkan Jacobsson

    Depending on the format of your files, you need not go into JAI. You may be able to do what you want with ImageIO.
    You just need to load the image, select the part you want, then check the length to width ratio to make sure it is appropriate, if not, then adjust it as such.
    If you want to get a 100, 100 thumb from a 1024, 768 image you can do this:
    BufferedImage bi = new BufferedImage(100, 100, BufferedImage.TYPE_INT_RGB);
    Graphics2D g = bi.createGraphics();
    g.drawImage(my1024x768, 0, 12, 100, 75, Color.BLACK, null);
    g.dispose();please note, that to get 1024 shunk up to 100, you need to divide by 10.24, when you do the same to the height of the image, you get 75, this leaves 25 pixels--so I centered the image at 12.
    to save the thumb in JPG:
    File f = new File(myFileNameAndPath);
    f.createFile();
    ImageIO.write(bi, "JPEG", f);**WARNING** untested code.

  • Questions about resizing and uploading pictures ...

    I have set up a desktop folder, and can store my resized pictures there through the export function in iPhoto.  When I export though, there doesn't seem to be any way to export directly to that folder.  Instead, I have to export to the desktop, then drag all those files into my desktop folder.  Is there any way to export my resized photos directly into that folder without having to first go to the desktop, then the folder?  It just seems like extra steps.
    Another nuisance I'm encountering is uploading to sites like eBay and PhotoBucket.  If I chose to browse files on my computer, all that opens is the iPhoto icon rather than individual image files.  I know I can drag and drop, but is there any way of directly accessing either the individual images in iPhoto or the desktop shortcut which contains my resized images?
    I am coming off years of working with Windows, and their system of simply opening My Pictures and selecting the images you want to upload seems much simpler than this.
    I am running OS X Mavericks with a MacBook Air 2013.
    Thanks for any help.

    The iPhoto export dialogue is the same as any other. I wonder if you're seeing this:
    When what you want is this:
    Which allows you to access the specific folders you want. You get this by clicking the button indicated.
    As for uploading photos:
    For help accessing your photos in iPhoto see this user tip:
    https://discussions.apple.com/docs/DOC-4491
    It's the first one you want...
    You can work your photos on your Mac just like you did on Windows, but you've chosen to use a database with lossless processing. So there is a learnign curve if you change not only your OS but you're entire system of managing your photos.

  • Images resized and exif stripped when emailed ?

    Does any know why the iPhone resizes images (to 640x480) and strips out EXIF data when you email a photo. However, if you download the photos you get the full size and EXIF data ?
    As i often like to email photos direct to Flickr from my iphone it is very annoying to end up with a poorer image than what i should have.

    Hello All,
    Great news for the Apple iPhone.
    Just downloaded 2.1 software update, and the Geotagging correctly geotags the southern hemisphere, now adds a GPS Time-Stamp as well as the GPS longitude & latitude info to the EXIF.
    AND, when you e-mail it or transmit the image to a secure server, mobleme, Flickr . . . ALLL OF THE EXIF DATA STAYS INTACT, INCLUDING THE GPS METATAGS . . .
    AND THE SIZE OF THE IMAGE HAS BEEN REDUCED FROM 1200 X 1600 TO 600 X 800 . . .

  • Image Resizing and Folio Renditions

    Hello!
    I'm building a pretty large app, and I'm concerned about the size of some of my larger images.
    A. Is it typical to build both 1024x768 and 2048x1536 renditions? Or should I just build the 1024x768 and size my full page images for the 2048x1536? Or will it automatically view them at 72dpi?
    B. If I do build both renditions, can I keep the two different layouts in the same file with alternate layout? Or would I have to build a separate folio like I would for the iPhone?
    C. What is the best format to save images in? I've always saved as jpgs, but if I'm able to save as a gif or png for file size, I'd prefer to do that. But I don't want to compromise the integrity of the photo either.
    Thank you!

    Depending on the format of your files, you need not go into JAI. You may be able to do what you want with ImageIO.
    You just need to load the image, select the part you want, then check the length to width ratio to make sure it is appropriate, if not, then adjust it as such.
    If you want to get a 100, 100 thumb from a 1024, 768 image you can do this:
    BufferedImage bi = new BufferedImage(100, 100, BufferedImage.TYPE_INT_RGB);
    Graphics2D g = bi.createGraphics();
    g.drawImage(my1024x768, 0, 12, 100, 75, Color.BLACK, null);
    g.dispose();please note, that to get 1024 shunk up to 100, you need to divide by 10.24, when you do the same to the height of the image, you get 75, this leaves 25 pixels--so I centered the image at 12.
    to save the thumb in JPG:
    File f = new File(myFileNameAndPath);
    f.createFile();
    ImageIO.write(bi, "JPEG", f);**WARNING** untested code.

  • Image resizing and interpolation plugin

    A friend reports that genuine factals plugin is a part of Photoshop CS3. I note that a plugin for Photoshop (version not given) is advertised for sale by OnOneSoftware.
    Any comments appreciated.

    The GF plug-in is not part of Photoshop, you buy it from OnOne Software.
    John

  • Why won't Photoshop revert to earlier history state after image resize when scripted?

    I've written an Applescript to automate watermarking and resizing images for my company. Everything generally works fine — the script saves the initial history state to a variable, resizes the image, adds the appropriate watermark, saves off a jpeg, then reverts to the initial history state for another resize and watermark loop.
    The problem is when I try not to use a watermark and only resize by setting the variable `wmColor` to `"None"` or `"None for all"`. It seems that after resizing and saving off a jpeg, Photoshop doesn't like it when I try to revert to the initial history state. This is super annoying, since clearly a resize should count as a history step, and I don't want to rewrite the script to implement multiple open/close operations on the original file. Does anyone know what might be going on? This is the line that's generating the problem (it's in both the doBig and doSmall methods, and throws an error every time I ask it just to do an image resize and change current history state):
                        set current history state of current document to initialState
    and here's the whole script:
    property type_list : {"JPEG", "TIFF", "PNGf", "8BPS", "BMPf", "GIFf", "PDF ", "PICT"}
    property extension_list : {"jpg", "jpeg", "tif", "tiff", "png", "psd", "bmp", "gif", "jp2", "pdf", "pict", "pct", "sgi", "tga"}
    property typeIDs_list : {"public.jpeg", "public.tiff", "public.png", "com.adobe.photoshop-image", "com.microsoft.bmp", "com.compuserve.gif", "public.jpeg-2000", "com.adobe.pdf", "com.apple.pict", "com.sgi.sgi-image", "com.truevision.tga-image"}
    global myFolder
    global wmYN
    global wmColor
    global nameUse
    global rootName
    global nameCount
    property myFolder : ""
    -- This droplet processes files dropped onto the applet
    on open these_items
      -- FILTER THE DRAGGED-ON ITEMS BY CHECKING THEIR PROPERTIES AGAINST THE LISTS ABOVE
              set wmColor to null
              set nameCount to 0
              set nameUse to null
              if myFolder is not "" then
                        set myFolder to choose folder with prompt "Choose where to put your finished images" default location myFolder -- where you're going to store the jpgs
              else
                        set myFolder to choose folder with prompt "Choose where to put your finished images" default location (path to desktop)
              end if
              repeat with i from 1 to the count of these_items
                        set totalFiles to count of these_items
                        set this_item to item i of these_items
                        set the item_info to info for this_item without size
                        if folder of the item_info is true then
      process_folder(this_item)
                        else
                                  try
                                            set this_extension to the name extension of item_info
                                  on error
                                            set this_extension to ""
                                  end try
                                  try
                                            set this_filetype to the file type of item_info
                                  on error
                                            set this_filetype to ""
                                  end try
                                  try
                                            set this_typeID to the type identifier of item_info
                                  on error
                                            set this_typeID to ""
                                  end try
                                  if (folder of the item_info is false) and (alias of the item_info is false) and ((this_filetype is in the type_list) or (this_extension is in the extension_list) or (this_typeID is in typeIDs_list)) then
      -- THE ITEM IS AN IMAGE FILE AND CAN BE PROCESSED
      process_item(this_item)
                                  end if
                        end if
              end repeat
    end open
    -- this sub-routine processes folders
    on process_folder(this_folder)
              set these_items to list folder this_folder without invisibles
              repeat with i from 1 to the count of these_items
                        set this_item to alias ((this_folder as Unicode text) & (item i of these_items))
                        set the item_info to info for this_item without size
                        if folder of the item_info is true then
      process_folder(this_item)
                        else
                                  try
                                            set this_extension to the name extension of item_info
                                  on error
                                            set this_extension to ""
                                  end try
                                  try
                                            set this_filetype to the file type of item_info
                                  on error
                                            set this_filetype to ""
                                  end try
                                  try
                                            set this_typeID to the type identifier of item_info
                                  on error
                                            set this_typeID to ""
                                  end try
                                  if (folder of the item_info is false) and (alias of the item_info is false) and ((this_filetype is in the type_list) or (this_extension is in the extension_list) or (this_typeID is in typeIDs_list)) then
      -- THE ITEM IS AN IMAGE FILE AND CAN BE PROCESSED
      process_item(this_item)
                                  end if
                        end if
              end repeat
    end process_folder
    -- this sub-routine processes files
    on process_item(this_item)
              set this_image to this_item as text
              tell application id "com.adobe.photoshop"
                        set saveUnits to ruler units of settings
                        set display dialogs to never
      open file this_image
                        if wmColor is not in {"None for all", "White for all", "Black for all"} then
                                  set wmColor to choose from list {"None", "None for all", "Black", "Black for all", "White", "White for all"} with prompt "What color should the watermark be?" default items "White for all" without multiple selections allowed and empty selection allowed
                        end if
                        if wmColor is false then
                                  error number -128
                        end if
                        if nameUse is not "Just increment this for all" then
                                  set nameBox to display dialog "What should I call these things?" default answer ("image") with title "Choose the name stem for your images" buttons {"Cancel", "Just increment this for all", "OK"} default button "Just increment this for all"
                                  set nameUse to button returned of nameBox -- this will determine whether or not to increment stem names
                                  set rootName to text returned of nameBox -- this will be the root part of all of your file names
                                  set currentName to rootName
                        else
                                  set nameCount to nameCount + 1
                                  set currentName to rootName & (nameCount as text)
                        end if
                        set thisDocument to current document
                        set initialState to current history state of thisDocument
                        set ruler units of settings to pixel units
              end tell
      DoSmall(thisDocument, currentName, initialState)
      DoBig(thisDocument, currentName, initialState)
              tell application id "com.adobe.photoshop"
                        close thisDocument without saving
                        set ruler units of settings to saveUnits
              end tell
    end process_item
    to DoSmall(thisDocument, currentName, initialState)
              tell application id "com.adobe.photoshop"
                        set initWidth to width of thisDocument
                        if initWidth < 640 then
      resize image thisDocument width 640 resample method bicubic smoother
                        else if initWidth > 640 then
      resize image thisDocument width 640 resample method bicubic sharper
                        end if
                        set myHeight to height of thisDocument
                        set myWidth to width of thisDocument
                        if wmColor is in {"White", "White for all"} then
                                  set wmFile to (path to resource "water_250_white.png" in bundle path to me) as text
                        else if wmColor is in {"Black", "Black for all"} then
                                  set wmFile to (path to resource "water_250_black.png" in bundle path to me) as text
                        end if
                        if wmColor is not in {"None", "None for all"} then
      open file wmFile
                                  set wmDocument to current document
                                  set wmHeight to height of wmDocument
                                  set wmWidth to width of wmDocument
      duplicate current layer of wmDocument to thisDocument
                                  close wmDocument without saving
      translate current layer of thisDocument delta x (myWidth - wmWidth - 10) delta y (myHeight - wmHeight - 10)
                                  set opacity of current layer of thisDocument to 20
                        end if
                        set myPath to (myFolder as text) & (currentName) & "_640"
                        set myOptions to {class:JPEG save options, embed color profile:false, quality:12}
      save thisDocument as JPEG in file myPath with options myOptions appending lowercase extension
                        set current history state of current document to initialState
              end tell
    end DoSmall
    to DoBig(thisDocument, currentName, initialState)
              tell application id "com.adobe.photoshop"
                        set initWidth to width of thisDocument
                        if initWidth < 1020 then
      resize image thisDocument width 1020 resample method bicubic smoother
                        else if initWidth > 1020 then
      resize image thisDocument width 1020 resample method bicubic sharper
                        end if
                        set myHeight to height of thisDocument
                        set myWidth to width of thisDocument
                        if wmColor is in {"White", "White for all"} then
                                  set wmFile to (path to resource "water_400_white.png" in bundle path to me) as text
                        else if wmColor is in {"Black", "Black for all"} then
                                  set wmFile to (path to resource "water_400_black.png" in bundle path to me) as text
                        end if
                        if wmColor is not in {"None", "None for all"} then
      open file wmFile
                                  set wmDocument to current document
                                  set wmHeight to height of wmDocument
                                  set wmWidth to width of wmDocument
      duplicate current layer of wmDocument to thisDocument
                                  close wmDocument without saving
      translate current layer of thisDocument delta x (myWidth - wmWidth - 16) delta y (myHeight - wmHeight - 16)
                                  set opacity of current layer of thisDocument to 20
                        end if
                        set myPath to (myFolder as text) & (currentName) & "_1020"
                        set myOptions to {class:JPEG save options, embed color profile:false, quality:12}
      save thisDocument as JPEG in file myPath with options myOptions appending lowercase extension
                        set current history state of current document to initialState
              end tell
    end DoBig

    As many others here I use JavaScript so I can’t really help you with your problem.
    But I’d like to point to »the lazy person’s out« – with many operations that result in creating a new file on disk I simply duplicate the image (and flatten in the same step) to minimize any chance of damaging the original file if the Script should not perform as expected.

  • PSE5 Process Multiple Files Image Resize

    I want to batch convert some TIFF files to JPG and make them all 300 ppi. I tried suing the Multiple file processor in the Editor just entering 300 in resolution and leaving width & height blank. I hoped it would perform the same process as going to image resize and and changing resolution with resample and constrain proportions turned off. Instead it has changed the ppi from 72 to 300, but kept the size the same i.e. has added lots of extra pixels making the file enormous.
    The only way I can force it to shrink the image is to enter say 30cm as the width. The problem with this is twofold a) I have to trun all my photos so they are landscape b) if I have cropped a photo such that it doesn't have enough pixels to stretch then again it is getting resampled.
    Is this a limitation of PSE5 that wouldn't be there in CS3 or am I doing something wrong? I only want to print tham out 15x10 but read I should resize everything to 300 ppi. To be honest I never did this before I had PSE and they seemed to come out OK from a Canon that saves the files as default 72 ppi but large dimensions. Maybe someone couldexplain in laymans terms why the photos need to be resized to 300 ppi anyway? Thank you

    Well, you see, Process Multiple files is doing just what you asked it to do: it's
    resizing the photos. But you don't really want to resize the photos, just change the ppi setting. Is there a particular reason you want them to be 300ppi? PPI is a setting that only matters for printing or if you are sending a photo somewhere that requires that marker to be set to 300. Your camera doesn't know anything about ppi, only absolute pixel dimensions (eg 2480 x 1795 or whatever).
    When you go to print, however, your printer may prefer to have a higher pixel density, since it can play your pixels like an accordian: squash them closer together or spread them out thinner, depending on that ppi marker. The pixel density determines the inch/cm size of your print (at 72 ppi you'll get a print that's hugely bigger but less detailed; at 300 ppi a crisper smaller print.)
    I'm wondering why you would want to batch convert a whole big bunch of images at once, though. It would help if you would explain just what you want to do with the photos that requires the 300 ppi.

  • Resize and Resample in Photoshop CC

    Hi.
    I use Photoshop since 1997 and jump from CS5 to CC this week. What I used to do sometimes is taking a 150dpi image and need to make it 72dpi, BUT I really want it to change pixels dimension. In PS CS5 I just needed to go to "Image Resize" and change 150 do 72dpi, and PS kept the Cm/Inches dimensions but changed pixels. Is exactly what I need to do. I PS CC it doesn't work, if I change dpi it will only change image size in Cm/Inches.
    And example, I have an Illustrator file, 800x800px. I export it as 150dpi JPG, opens in PS. It will show an image like 1667x1667px 150dpi. I want to change it to 72dpi so my JPG will be 800x800px again.
    Some people will say: "but why don't you already export from ILL as 72dpi?". Because I sometimes need those images in 150 and sometimes in 72. So I prefer to have a 150dpi image and resize to 72 if I need instead the opposite.
    Do you know if there is a way in PS CC to solve it?
    Thanks,
    Luiz

    DPI PPI  and an image's DPI resolution setting and Inkjet Printers DPI Resolution setting ???
    Dots Per Inch is an old printers term that came about when images were printed black and white using little dots of inks fined dots finer sharper images it density of dots size of dots image like news papers.  Later color image usinf 4 colors CMYK...
    Pixels Per Inch a term use about displays color pixels are three color Red Green Blue their geometry layout varies and some have even added a fourth yellow component  again its a density size display are manufactured with a single PPI density.  Different displays panels have their manufactured PPI. Most desktop LCD panels today have a ppi around 100.  Displays do not support your Image Files DPI resolution setting the display pixels their PPI size.  Image sizing on displays is done by scaling  the numbers of pixels in a image a displaying the scaled image not the actual images pixel. Zooming percent....
    Inkjets printers do not print like news papers and the do not use a single drop or dot of ink per image pixel.  The user their higher finer drops of ink to paint in you images larger square pixels. You inkjet printer can print pixels and siy up to the maximum resolution. Your printer DPI setting is a quality setting the higher the setting the finer the pixels will be painted in.  Higher quality settings are only available on high quality Photo paper for more ink is laid down and requires a special surface to prevent ink running pixels together regular paper would receive to much ink and be more a blotter paper.
    Image DPI setting defines/sets the image Pixel size without changing a single pixel in am image you can print the image any size you want by changing the size of its pixels.

  • Resize image from local drive and upload to server

    Hi there
    I want to allow the user to chose an image from his local
    hard drive.
    The image should then be loaded into the Flex 2 application.
    There I wanna show him infos about the image e.g. height and
    width.
    He should then be able to scale/resize the image and upload
    it to the server.
    I have no idea how to do that :-)
    Any thoughts on that?
    Thanks in advance
    Bernd

    Well in short, you need a second language to support that,
    e.g. PHP/ASP/CF.
    First you'll have to build a GUi in which you can upload the
    jpg, putting it to the server using php/asp/cf, then you'll need to
    make a call to that image, (importing it into your flex), then
    you'll have to set the parameters for the resizing, then you'll
    have to call a php/asp/cf script which does te resizing

  • CFTEXTAREA, FCKEditor and Image resizing

    I'm trying to use FCKEditor with CFTEXTAREA to build a basic blog and allow placing a photo in the post.  Everything is working fine, including the file upload features, but what I want to do is force the image to resize on upload if the file is over a certain size.  As I look through all the CFCs, it appears that the functionality is there, but I can't figure out how to activate it.  Does anyone have any ideas?
    Thanks all.

    Althou there are couple of image component files in the fckeditor folder I don't think this feature has been built into the fckeditor.  This is something you would have to implement yourself.
    Also you would be better of getting new standalone version of fckeditor and not using the one that came with CF.  One that came with CF is old and there were few updates since then.

  • Resizing images - portrait and landscape

    Hi,
    I am uploading and resizing images(see code), I want to
    resize them to 200px by 150px if landscape and 150px by 200px if
    portrait. How can I determine the orientation of the image?

    Well, first of all you would need to know what the initial
    image dimensions are. And the way to do this is to get the current
    images height and width from reading the image. You would then
    compare the width number to the height number and if the width is
    greater than the height, you know that it's more of a landscape
    photo...and vice versa.
    Try this code:
    <cfimage action="read"
    source="#expandPath("graphics/corner.png")#" name="myImage" />
    <cfdump var="#variables.myImage#" />
    <cfif variables.myImage.width gt
    variables.myImage.height>
    Landscape
    <cfelseif variables.myImage.width lt
    variables.myImage.height>
    Portrait
    <cfelseif variables.myImage.width eq
    variables.myImage.height>
    Square
    <cfelse>
    Something else for whatever reason.
    </cfif>
    At least, I think this is how you'd do it. I know it's not
    the most elegant way...you might want to look at ColdFusion image
    functions rather than reading the whole image in, I think there are
    functions just to get width and height, which I imagine should give
    you better performance.
    Good luck,
    Mikey.

  • How to Reduce Image Size and show upload Progress Bar

    i need to capture an image from the camera and send it to the server. however to reduce the amount of data transmitted i want to shrink the image and lower its resolution.
    I have code that currently does the following :
    UIImage *testImage = [UIImage imageNamed:@"image1.png"]; // this would come from image picker
    NSData * imageData = UIImagePNGRepresentation(testImage);
    // skipped code that showed URL string setup
    NSString *postLength = [NSString stringWithFormat:@"%d", [imageData length]];
    NSMutableURLRequest *request = [[[NSMutableURLRequest alloc] init] autorelease];
    [request setURL:[NSURL URLWithString:urlString]];
    [request setHTTPMethod:@"POST"];
    [request setValue:postLength forHTTPHeaderField:@"Content-Length"];
    [request setHTTPBody:imageData];
    NSURLConnection *conn=[[NSURLConnection alloc] initWithRequest:request delegate:self];
    1. need some way to shrink the image size to reduce data traffic
    2. need some way to indicate a progress bar as data is being transfered to the server

    1. The size is visible in the metadata panel, set the dropdown to EXIF. In addition, in the Grid, with Ctrl-J, you can set the options so that you will see the cropped size in the rectangle surrounding the photo.
    2. You cannot, in one action, upload to multiple galleries. Each upload is its own action. I don't know if there is a plug-in to let you upload from LR to 500px in one action; clearly there are plug-ins for Flickr and Smugmug and several others. There should be no need to re-import. Normally, the plug-ins I mentioned will take a TIFF, resize it according to your directions, convert to JPG and upload.

Maybe you are looking for

  • I can no longer zoom in my messages in mail since upgrading to Lion

    I have a Mac Book Pro with an intel i5 processor and 4GB of ram.  Since I have upgraded to Lion I can no longer zoom in on my messages in Mail.  I was able to do this in Snow Leopard when ever the text size was too small.  Is there a way to make the

  • Whats is diffrence between Dataguard and Stand by?

    Hi All I was asked for diffrence between Dataguard and StandBy Database in an interview. I answered that prior to 9I, (in 8i) It was called StandBy Database and from 9I onwards, It is called DataGuard. But interviewer doesnt seems to be satisfied wit

  • Embed video into email

    Hello I have a client who wants me to embed a video trailer into an email so that he doesn't have to attach it. Does anyone know how I can do this? Thanks Grant

  • I would like to buy a flat bed scanner in the uk compatible with my iMAc 10.8.4

    I would like to buy a flat bed scanner in the uk compatible with my iMAc 10.8.4. There seems to be a gap of information between Apple and say Epson on what drivers are suitable any Ideas?

  • Verify values in each partition

    Hi, I have a table that is partitioned by day. Every they there maybe values putted in the table or not. This table is used to place alarms. I have a fields : week_id. To check what week_id is loaded into the day and to check how many week_id's are i