Is opportunity to resize images resource-intensive?
Hello to ALL!!!
I'm trying to make a site with image gallery(for example -
pets).And I've thought about optimal size of full image. I've
chosen 640x480. And I'm going to use <imageresize> command
for images greater than 640/640. But I don't know(in practice) is
it a good idea to give opportunity to people to resize their images
with code of my site? I mean how resource-intensive this process
for a server? And what will happen if for example 500 people will
want to make "resize operation" at the same time?
Thank you for your coments/answers!
if you are seriously going to have 500 people resizing at
once, I would
suspect you might have issues.
But for just average occasional uploads, you should be fine.
In my work so far with simple or even large batch resizing, I
have not
seen any major drag.
In fact I am overall very impressed with the speed and
quality of image
resizing in CF8.
a bit OT:
here's a post about some code i've been working on for
batch-resizing in
multiple folders, coupled with a jquery photo gallery ... if
you *or any
other cf users* are interested, I am looking for testers
http://www.miuaiga.com/index.cfm/2008/10/14/CF-Gallery-Creator--jQuery-Slider-Gallery
Michael Evangelista, Evangelista Design
Web : www.mredesign.com Blog : www.miuaiga.com
Developer Newsgroups: news://forums.mredesign.com
Similar Messages
-
Writing Adobe Image Resource Block to a Tiff file
Background :
I am working on a small .NET application which reads the tiff file and performs some metadata related operations on it.
The program works fine with all of the tiff Images that are taken from photoshop. I have recieved a tiff file from the client which does not work with the program.
I checked the metadata info for the file using imagemagik following is the output
Format: TIFF (Tagged Image File Format)
Mime type: image/tiff
Class: DirectClass
Geometry: 6986x3754+0+0
Resolution: 96x96
Print size: 72.7708x39.1042
Units: PixelsPerInch
Type: TrueColorAlpha
Base type: TrueColor
Endianess: MSB
Colorspace: sRGB
Depth: 8-bit
Channel depth:
red: 8-bit
green: 8-bit
blue: 8-bit
alpha: 8-bit
Channel statistics:
Red:
min: 37 (0.145098)
max: 255 (1)
mean: 215.041 (0.843299)
standard deviation: 48.8483 (0.191562)
kurtosis: 0.845012
skewness: -1.09632
Green:
min: 25 (0.0980392)
max: 255 (1)
mean: 213.399 (0.836859)
standard deviation: 50.853 (0.199424)
kurtosis: 0.908226
skewness: -1.09806
Blue:
min: 21 (0.0823529)
max: 255 (1)
mean: 210.495 (0.825471)
standard deviation: 53.6527 (0.210403)
kurtosis: 0.124965
skewness: -0.929882
Alpha:
min: 64 (0.25098)
max: 255 (1)
mean: 254.948 (0.999796)
standard deviation: 2.56957 (0.0100768)
kurtosis: 2437.44
skewness: 49.3893
Image statistics:
Overall:
min: 0 (0)
max: 255 (1)
mean: 159.747 (0.626458)
standard deviation: 44.321 (0.173808)
kurtosis: 48.4205
skewness: -8.00071
Rendering intent: Perceptual
Gamma: 0.454545
Chromaticity:
red primary: (0.64,0.33)
green primary: (0.3,0.6)
blue primary: (0.15,0.06)
white point: (0.3127,0.329)
Background color: white
Border color: srgba(223,223,223,1)
Matte color: grey74
Transparent color: none
Interlace: None
Intensity: Undefined
Compose: Over
Page geometry: 6986x3754+0+0
Dispose: Undefined
Iterations: 0
Compression: LZW
Orientation: TopLeft
Properties:
date:create: 2014-02-15T21:18:37+06:00
date:modify: 2014-02-09T16:29:10+06:00
signature: a5c4a9415437ee2d3b0c3d860b30c5367f73fe7553c3f54923caf6da4b9e4623
tiff:alpha: unassociated
tiff:endian: lsb
tiff:photometric: RGB
tiff:rows-per-strip: 3754
Artifacts:
filename: C:\Users\Jane\TiffPathOperation\bin\Debug\Example1client_no_path.tiff
verbose: true
Tainted: False
Filesize: 14.6MB
Number pixels: 26.23M
Pixels per second: 54.64MB
User time: 0.484u
Elapsed time: 0:01.479
Version: ImageMagick 6.8.7-4 2013-10-26 Q16 http://www.imagemagick.org
Unlike other tiff images this image does not contain 8bim profile information, which is required for proper execution of the program
Profiles:
Profile-8bim: 11720 bytes
Profile-icc: 3144 bytes
Description: sRGB IEC61966-2.1
Manufacturer: IEC http://www.iec.ch
Model: IEC 61966-2.1 Default RGB colour space - sRGB
Copyright: Copyright (c) 1998 Hewlett-Packard Company
Profile-xmp: 19368 bytes
Possible solution :
I would have to add the Image resource block data to such image in which the profile information is missing.
Problem :
I would have to write metadata for the tag 34377 as given in the Adobe Specification for the listed resource Id
How am I suppose to write this entire block and assign it to the Tag 34377 in C#?
What values should be added for each resource Id ?
Tiff Image : http://1drv.ms/NtzbCrBypassing the portion of the file is not a option in my case since a part
of the program reads the bytes and performs operation on the image when it
reads 8bim.
The image if re-saved in Photoshop gets the required metadata. (Can be seen
by using imagemagik's identify utility)
Only option that I have is to write the information for the resource in
side the Image resource block tag.
How am I suppose to write this resources when I am using BitmapMetadata
class?
Regards,
Charanraj Golla -
How to create resized image instance from an existing image
It looks like the image class does not provide a possibility to create a resized instance. Image#impl_getURL() would be good enough to create a resized instance of an existing image - but could be removed in a future release. So what's the preferred way if I have an image object only - there's no information about the based image resource.
You can resize an image on loading using one of the constructors that takes requestedWidth and requestedHeight parameters. This is useful for preserving memory when (for example) needing to display a large number of thumbnails.
Additionally, the ImageView class defines resizing functionality for the view of an Image. So you can load the full Image, then display one or more resized versions in ImageView(s).
If you need, you can retrieve an Image object representing the ImageView by calling snapshot(...) on the ImageView; for most use cases the ImageView itself will be all you need. -
Which approach to use for resizing image
There are two ways of resizing images as I know:
1. image.getScaledInstance(width,height,hint);
Using hint like Image.SCALE_AREA_AVERAGING gives somehwat satisfactory resizing.
2. static BufferedImage resize(GraphicsConfiguration gc, BufferedImage source, int w, int h, Object hintValue) {
BufferedImage result = gc.createCompatibleImage(w, h, source.getTransparency());
Graphics2D g2 = result.createGraphics();
g2.setRenderingHint(RenderingHints.KEY_INTERPOLATION, hintValue);
double sx = (double) w / source.getWidth(), sy = (double) h / source.getHeight();
g2.drawRenderedImage(source, AffineTransform.getScaleInstance(sx, sy));
g2.dispose();
return result;
where the hint passed is RenderingHints.VALUE_INTERPOLATION_BILINEAR ;
Now which of the two method method should I use-using image.getScaledInstance() or using AffineTranform ? opr is there any other way which is faster but provides good result?
i am creating an image editor, so the GUI dialog will have oprtion to choose the algorithm. I want the method which provides better result yet faster.
Tanveerhttp://forum.java.sun.com/thread.jsp?forum=20&thread=522483
-
Need help on quality of resized image!!
I am required to resize images to max 1240pixel (longest dimension) as a submission of work, though when work is viewed it will be at 30"x40". Can not figure out a way to do this where images don't become quite pixelated when viewed at larger size. Appreciate any suggestions.
Is there some software to verify if my graphics card is shotty?
Techtool Pro has some testing, the AHT tests VRAM, but game benchmarks and stressing will tell you the most.
Is re-seating the graphics card or memory worth trying?
Absolutely. Just don't reinstall the graphics card until you clean it thoroughly.
Cleaning the dust out of my machine?
YES. A dust filled graphics card heatsink will cause the GPU to cook, and cause problems thet you describe.
If I need a new graphics card, what are my options? Do I have to purchase it via Apple store? I would like to stick with an Nvidia card so am I stuck buying the same card I currently have or can I upgrade?
You don't have to buy from Apple, but using with OS X limits your choices to Mac compatible or flashable PC versions.
There is an awful lot of user input into this topic here:
http://blog.macsales.com/602-testing-those-new-graphics-cards
Card reviews can also help:
http://www.anandtech.com/video/showdoc.aspx?i=3140&p=9
http://www.tomshardware.com/reviews/radeon-hd-4870,1964.html -
I need some help resizing my images on PS6. I am using a mac and have been trying to resize with same resolution and constaining proportions but for some reaseon the smaller resized image appears pizelated. Heres an image of before and after. The first image I use is a JPG 72dpi 1500px x1500px and I want to downsize it to 600x600px same res, but it keeps pixelating, this has never happened before. Any suggestions, thoughts?
thanks!I wouldn't say pixelated; more like blurry.
Like ConnectedCreative said, what steps are you using? Are you using "bicubic sharper" when resizing down? -
Upload and Resize Image not inserting filename in database
I have a form that I created using the insert record form wizard. One of the fields is a file field and my form enctype is set to multipart/form-data. I then used the upload and resize image behavior and set the parameters. When testing the form the file uploads to the correct directory but no entry is made into the database for that particular field. The other fields are entered into the database just fine. If it helps, here is the code generated before the tag:
<br />
<br /><?php require_once('../../Connections/test.php'); ?>
<br /><?php<br />// Load the common classes<br />require_once('../../includes/common/KT_common.php');<br /><br />// Load the tNG classes<br />require_once('../../includes/tng/tNG.inc.php');<br /><br />// Make a transaction dispatcher instance<br />$tNGs = new tNG_dispatcher("../../");<br /><br />// Make unified connection variable<br />$conn_test = new KT_connection($test, $database_test);<br /><br />// Start trigger<br />$formValidation = new tNG_FormValidation();<br />$tNGs->prepareValidation($formValidation);<br />// End trigger<br /><br />//start Trigger_ImageUpload trigger<br />//remove this line if you want to edit the code by hand <br />function Trigger_ImageUpload(&$tNG) {<br /> $uploadObj = new tNG_ImageUpload($tNG);<br /> $uploadObj->setFormFieldName("picture");<br /> $uploadObj->setDbFieldName("picture");<br /> $uploadObj->setFolder("../images/");<br /> $uploadObj->setResize("true", 120, 0);<br /> $uploadObj->setMaxSize(1500);<br /> $uploadObj->setAllowedExtensions("gif, jpg, jpe, jpeg, png, bmp");<br /> $uploadObj->setRename("auto");<br /> return $uploadObj->Execute();<br />}<br />//end Trigger_ImageUpload trigger<br /><br />// Make an insert transaction instance<br />$ins_team = new tNG_insert($conn_test);<br />$tNGs->addTransaction($ins_team);<br />// Register triggers<br />$ins_team->registerTrigger("STARTER", "Trigger_Default_Starter", 1, "POST", "KT_Insert1");<br />$ins_team->registerTrigger("BEFORE", "Trigger_Default_FormValidation", 10, $formValidation);<br />$ins_team->registerTrigger("END", "Trigger_Default_Redirect", 99, "../team.php");<br />$ins_team->registerTrigger("AFTER", "Trigger_ImageUpload", 97);<br />// Add columns<br />$ins_team->setTable("team");<br />$ins_team->addColumn("id", "NUMERIC_TYPE", "POST", "id");<br />$ins_team->addColumn("sort", "NUMERIC_TYPE", "POST", "sort");<br />$ins_team->addColumn("name", "STRING_TYPE", "POST", "name");<br />$ins_team->addColumn("title", "STRING_TYPE", "POST", "title");<br />$ins_team->addColumn("description", "STRING_TYPE", "POST", "description");<br />$ins_team->addColumn("picture", "FILE_TYPE", "FILES", "picture");<br />$ins_team->setPrimaryKey("id", "NUMERIC_TYPE");<br /><br />// Execute all the registered transactions<br />$tNGs->executeTransactions();<br /><br />// Get the transaction recordset<br />$rsteam = $tNGs->getRecordset("team");<br />$row_rsteam = mysql_fetch_assoc($rsteam);<br />$totalRows_rsteam = mysql_num_rows($rsteam);<br />?>If the reason is about memory, warning message should be happened when upload the image, because "show thumbnail" means resize at second time, how come you failed to resize the picture that system let it upload succeed at the first time by the same resize process?
upload procedure
a.jpg: 2722x1814, 1.2mb
upload condition: fixed width 330px, 1.5mb
"upload and resize" a.jpg -> file upload -> "resize engine" -> passed (but not work and no warning message)
"show thumbnail" a.jpg -> "resize engine" -> failed (not enough memory)
it doesn't make sense.
and you miss an important key point, I upload the same picture myself, and resize work, so I said it happened at random, and that's why I am so worried. -
I need to resize image in pdf ,
I get this [http://www.java2s.com/Tutorial/Java/0419__PDF/Positionandresizeanimage.htm]
I try to put the code in my servlet
but I get error on not static method on PdfContentByte cb = writer.getDirectContent(); how to deal this problem
Thank YouPdfContentByte cb = writer.getDirectContent();There is no such method in the JDK or the Servlet API.
Ask whoever provides it. -
Resizing images published through flickr, but I don't want it to.
I set up a flickr connection with LR3, very cool. However it resized the image to 1024x768, though I have nothing set under 'resize'. Why is it doing that? Do I have to set it to resize everything to 9000 pix and not enlarge for it to keep the original size?
Setting the resolution to 9000 x 9000 wont make any difference. Or at least it did not for me.
It could be a limitation of Flickr (no Pro account). Perhaps it is different with a Pro account.size file is being uploaded if you dont resize on output but you wont see it if you dont have a Pro account.
In fact, from the Flickr site: Only smaller (resized) images accessible (though the originals are saved in case you upgrade later)
This would suggest that your original size file is being uploaded if you dont resize on output but you wont see it if you dont have a Pro account. -
Add image resource to the ".r" file
Hi,
I'd like to embed small (16x16 pix) image resources (ex. png, jpeg) into the ".r" file. How can I do this?You can use the 'read' command. See "Building and Managing Programs in MPW" for a complete reference to Rez:
http://developer.apple.com/tools/mpw-tools/books.html#Building -
Problem with getting resized image's bytes
I've got a problem with getting correct bytes of a newly resized image. The flow is that I retrive an image from the filesystem. Due to the fact that it is large I resize it to a 50x50px thumbnail. I can display this thumbnail in #benchmark1 (see code below). Unfortunately something's wrong with my imageToBytes funtion which returns reasonably small size of image but is totally useless - I can't make an image of it anymore so at #benchmark2 the application either crashes or keeps freezing. I saved this byte array on my disk and tried to preview under Windows how does it look but I got a message "Preview unavailabe". I did some digging in the Internet and I supposed that it's because I don't use any jpg or png encoders to save the file. Actually I think that it's not the case, as the bytes returned from method imageToBytes look weird - I cannot even make a new image of them and display it without any saving in memory.
byte[] bytes = FileHandler.readFile (
FileHandler.PHOTOS_PATH, fileName);
Image img2 = Image.createImage (bytes, 0, bytes.length);
img2 = ImageHandler.getInstance ().resize (img2);
//#benchmark1
bytes = ImageUtils.imageToBytes (img2);
img2 = Image.createImage (bytes, 0, bytes.length);
//#benchmark2my imageToBytes function is as follows:
public static byte[] imageToBytes (Image img)
int[] imgRgbData = new int[img.getWidth () * img.getHeight ()];
byte[] imageData = null;
try
img.getRGB (imgRgbData, 0, img.getWidth (), 0, 0, img.getWidth (),
img.getHeight ());
catch (Exception e)
ByteArrayOutputStream baos = new ByteArrayOutputStream ();
DataOutputStream dos = new DataOutputStream (baos);
try
for (int i = 0; i < imgRgbData.length; i++)
dos.writeInt (imgRgbData);
imageData = baos.toByteArray ();
baos.close ();
dos.close ();
catch (Exception e)
return imageData;
I've run totally out of any idea what's wrong, please help!
Edited by: crawlie on Jul 17, 2010 6:21 PMHey Crawlie,
Please note that simply writing int values into ByteArrayOutputStream will not suffice. Please have a look at the following conversion from int pixel value into byte[4]:
public static final byte[] intToByteArray(int value) {
return new byte[] {
(byte)(value >>> 24),
(byte)(value >>> 16),
(byte)(value >>> 8),
(byte)value
}Good Luck!
Daniel -
Resizing Image and Not Keep Aspect Ratio
Is there a free program to resize images and not keep the original aspect ratio?
I need to resize loads of images to 100x100 pixels and have tried Image well and IResize yet they do not seem to have an option to not keep the original aspect ratio.
Thank you
20" Intel 2GHz Core Duo imac, 2GB Ram, 250 GB HDHi, Downsize does not seem all that great according to reviews. Why not see if you can buy PS E' 3 mac -- maybe ebay/amazon (if I remember I only paid about $70 for PS E3) As PS E4 just came out I'm sure someone has PS E3 for sale. You will then have no problems completing your image resizing.
2 other questions for you..are you using the Mac side of your intel or Windows?
if your using the Windows side I can let you have PS 6 (PC) ..freegratus. -
I am using Photoshop CS (older version).
I am having a problem with resizing images. Prior to sending this, everything was working okay and now nothing will resize. my file path was file menu > automate > batch > and then I would choose my source and destination for the resized images. In the end, all the newly resized images would stay the same size as before. Can someone please help me with this???Neil,
Have you selected the "resizing" action in the Batch dialog? -
I opened up PSE 4.0 today and I resized an image and it said that it was resized (6x9 became 5x7, for example), but when I dragged it to my project, it was still the same size (not smaller)! Prior to today, it has always been the size that I wanted it to be. I have not changed anything in PSE so I am wondering if anyone knows how to fix this so I can resize images again.
Thanks so much!Hey Erica,
You can resize the image using the move tool even after placing it in the project.
Cheers,
Chhaya -
Cannot Resize Images in Elements 8
Hi,
I recently had my laptop stolen and I had to reinstall in Elements 8 on my new computer. Since then, I have unable to resize images. I go to Image -> Resize -> Image Size and the pixel dimensions box is grayed out and I am unable to change the pixel dimensions. The document size function works fine and is not grayed out.
It's very odd and frustrating. Perhaps a simple fix, but I am totally stumped.
Thank you for any assistance you can give.In order to change the pixel dimensions you must first turn on the Resample Image checkbox, since shedding or adding pixels necessarily involves resampling. Try it with that turned on.
Maybe you are looking for
-
Hi I am using this query for retreiving the records from sql server. When the query select "e1" as emp,"e2" as date,"e3" as one_year rom "tablename"@databaselink it is working fine but when the same query is used with the convert function on one of t
-
I have the opposite problem to most people in that having installed version 8 I *cannot* associate .png files or others with Fireworks. If I go to "open with" Fireworks is not an option. If go via control panel->file types->Advanced and select the ex
-
Hi, I tried to retrieve the delivery number with vendor code(LIFNR) in VLKPA-KUNDE. But, nothing is returned. Is there any other index table that provide the same information. Regards, Kit
-
Hi, If completed my application for data acquisition, onlyi'mnot that happywithmy waveform chart... It shows gaps, time to time? And i don't know why? Here is an example: Does anyone has a solution for this? Regards, Thijs
-
SCA-111000 (IIS 5.0 and 4.1 IOS)
Hello, I am configuring the the above device, and would like to know how do I update the OS to 4.1 version and how to import the IIS 5.0 certificate and key into the Secure content accelerator config manager. I also need the 4.1 IOS to upload it to m