crop

Resize and crop images before displaying in UITableViewCells

Hello, i have an UITableView in my app and i have to load some images that have a fixed width but different heights. I download the images async using an NSOperationQueue and for resizing and cropping i tried to use the solution provided by Jane Sales in this post link text. i made a custom UITableViewCell class and in it i have a meth...

Crop image using php

I want to crop an image. Is it possible to do like this. And if yes, how would the crop() function look like? $imgURL is always a .jpg image. $image = file_get_contents($imgURL); $maxWidth = 100; $height = 68; $image = crop($image, $maxWidth, $height); file_put_contents("media/imgname.jpg", $image); function crop($image, $maxWidth, ...

Using System.Drawing to make a selection tool, and cropping an image in vb.net

If i wanted to crop an image in VB.net, how would I go about doing it? I am trying to let the user drag out the box they want (system.drawing.rectangle), and it will automatically remove the edges surrounding the box. My first problem is primarily the fact that I cannot make the system.drawing.rectangle visible. It is not displaying at ...

How to crop a mp3 in ASP.NET + C#?

I am in an ASP.NET project using C#. The users can upload their MP3 (I have no control over the encoding) and specify a sample size and a sample starting point. On save, the system needs to create a sample of this MP3 based on the information provided. So the question is: How can Icrop a mp3 in ASP.NET + C#?? ...

How to crop a mp3 from x to x+n using ffmpeg?

Following this question I decided to use ffmpeg to crop MP3s. On another question I found this way of doing it: ffmpeg -t 30 -acodec copy -i inputfile.mp3 outputfile.mp3 The problem is that I don't want to crop the first 30 seconds, I want to crop from x to x+n, like from 30s to 100s. How would I go and do this? I'm reading the man f...

PHP - Mask polygon over image

Hi Everyone (this is my first post), I am trying to figure a way of cropping a polygon out of an image. I have been reading other similar code. It seems that most code is based around the following process: -Resize the image to fit the width and height of the polygon shape, -Create a blank image of an unusual colour the same size, -O...

Best resize and or crop logic

Hey guys, I've come across this a few times and thought it would be good to put it out there. What's your best image resize and/or crop logic. The idea being that some method is called with a target image, dimensions and a crop flag - this would return or save off or whatever the desired image. Mine is below. Converted from VB to C#...

Crop image in flex using a non-rectangular shape

Hi I've been following this tutorial to crop images in flex: http://code.mediablur.com/ImageCropper/ImageCropperDemo.html. At the heart of its cropping is using a method called "copyPixels". However, this method takes as one of its arguments a rectangular shape for its crop region. Are there other strategies I can use to crop it not u...

Crop whitespace from image in PHP

Is it possible to remove the whitespace surrounding an image in PHP? NOTE: to clarify I mean something like photoshops trim feature. Thanks. ...

PHP Memory Limit 25MB Exhausted - File Upload/Crop/Resize

I'm using a single image upload/crop/resize script for files up to 10MB. When testing, I set php_ini memory limit to 25M and that is exhausted when uploading a file only about 1.4MB. "Allowed memory size of 26214400 bytes exhausted (tried to allocate 10368 bytes)" This seems strange to me, isn't 10368 < 26214400? (Rhetorical Questi...

Getting the visible rect of a zoomed UIImage on the screen

I have a UIImageView inside a UIScrollView. The UIImageView contains a UIViewContentModeScaleAspectFit content mode. I've also set the content size of the UIScrollview to the frame size (width, height) of my UIImageView and implemented a UIScrollview delegate method (viewForZoomingInScrollView:) to enable the zooming feature of my app. ...

An image cropper: How to prevent the default drag n' drop action?

I am developing an image cropper and would like to ask you the following question: In order to prevent the default drag n' drop action when you press the left button on an image and keeping it pressed try to move the mouse, wouldn't it be cross-browser if to just use the picture as a background to a div box? Just like so: <div id="the...

How to crop image after taken from UIImagePicker Camera?

I'm trying to allow the user to take 16x9 aspect ratio images to look like they are nice HD photos. I'm using the cameraViewOverlay to overlay black bars on both ends, but when the image is taken, how do I crop the top and bottom without resizing or changing the scale of the image? Thanks. ...

as3 copy custom shape out of bitmap

So, I have bitmapA which is rectangular. I have a crop area I want to copy... However, the bitmap is at an angle from the crop. How do I copy a section from a bitmap that isn't a rectangle laid outon the x, y, axis?? Or copy custom shape???? Thanks ...

Crop image in PHP

Hello, The code below crops the image well, which is what i want, but for larger images, it wotn work as well. Is there any way of 'zooming out of the image' Idealy i would be able to have each image roughly the same size before cropping so that i would get good results each time Code is <?php $image = $_GET['src']; // the image to ...

Scaling and cropping huge image on the iPhone

Hi All, For the last few weeks I've been tearing my hair out trying to get a tiling mechanism working on an iPhone. I need to scale and crop images of about 150mb so that they can be saved as tiles that will be requested by a scroll view, allowing the user to see the image in high resolution. The problem is that these images are really...

Command line batch image cropping tool

is there any lightweight command line batch image cropping tool(Linux or Windows) which can handle a variety of the formats ? ...

Crop a UIImage from the Center outwards?

I am making a camera app which includes digital zoom. I have a slider (zoomSlider) that has a minimum value of 1 and a maximum value of 4. When the user taps the camera button, it takes a picture, and then I crop it for the zooming. I have two problems: How do I crop the exact middle of the image? (eg. 2x zoom, Rect would be centered wi...

object specific batch cropping

Is there a way to crop (delete) an object out of a series of image files? The object's characteristics are consistent between files, but the placement along the Y-axis varies. Attached are two examples of files, from which I would like the "step" bars removed. I would like to build a script to be able to recognize and remove them from ...

iPhone - How do you make a resizable rectangle for cropping images?

Hi everyone, I'm having a trouble making a re-sizable rectangle for cropping my images. I'm trying to achieve something like this picture: http://img192.imageshack.us/img192/8930/customcropbox.jpg Well, the only problem is I have no clue where to actually start. I need some advice to how I can achieve this effect of cropping. What docu...