crop

Using just CSS, crop .img keeping aspect without distortion

落花浮王杯 提交于 2019-12-21 05:21:07
问题 I have an image that has been placed inside a div. The div is 600 width and has a variable height. I want my image to sit at the top of the div. If I make the width 590 the issue is that the image is then too high in terms of design and it looks too dominant on the page (because its ratio is roughly 4:3 etc). So I want to make the image 590 by 200. If i use... .img { width: 590px; max-height: 200px; } ...then the image sits inside the div exactly how I want it. However, the photo itself is

Android Custom Camera - Crop image inside Rectangle

别等时光非礼了梦想. 提交于 2019-12-21 04:45:15
问题 I have a custom camera app which have a centered rectangle view, as you can see below: When I take a picture I want to ignore everything outside the rectangle. The view hasn't any connection with the Camera Preview or SurfaceView in my XML view, as follows: <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent"> <FrameLayout android:id="@+id/preview" android:layout_width="fill_parent" android:layout_height

How to crop a image with php using jquery imgAreaSelect?

会有一股神秘感。 提交于 2019-12-21 04:40:53
问题 i'm using the following javascript code to instanciete jquery imgAreaSelect to crop my image. $(document).ready(function () { $('#ladybug').imgAreaSelect({ onSelectEnd: function (img, selection) { $('input[name="x1"]').val(selection.x1); $('input[name="y1"]').val(selection.y1); $('input[name="x2"]').val(selection.x2); $('input[name="y2"]').val(selection.y2); } }); }); This relates to the following (example) html code: <div> <img id="ladybug" src="ladybug.jpg" alt="" /> </div> <div> <form

Obey the MediaBox/CropBox in PDF when using Ghostscript to render a PDF to a PNG

删除回忆录丶 提交于 2019-12-21 03:54:14
问题 I've been using Ghostscript to convert my single figure plots rendered in PDF to PNG: gswin32c -sDEVICE=png16m -r300x300 -sOutputFile=junk.png ^ -dBATCH -dNOPAUSE Figure_001-a.pdf This works in the sense I get a PNG out and it contains the plot. But it contains a huge amount of white space as well (an example source image: http://cdsweb.cern.ch/record/1258681/files/Figure_001-a.pdf). If you view it in Acrobat you'll note there is no white space around the plot. If you use the above command

iOS - how to implement crop image like default photo album?

淺唱寂寞╮ 提交于 2019-12-21 00:46:50
问题 The default crop function in iPhone photo album Does any one know how to implement this? I want to crop it before Use button is tapped. 回答1: Try one of these: https://www.cocoacontrols.com/search?utf8=%E2%9C%93&q=crop You might find an open source that does exactly that 回答2: If I understand your question correctly, you want to present a UIImagePickerController with the ability to crop the picture before picking it. This is built-in into UIImagePickerController, just set the allowsEditing

iOS: Cropping a still image grabbed from a UIImagePickerController camera with overlay

时光怂恿深爱的人放手 提交于 2019-12-20 15:34:29
问题 I am new to iOS and I have been bashing head against the wall for this for the past week looking around online for tutorials such as: Dealing with Exif Images, Resizing images, and many more random questions here on StackOverflow. From these, I figured that >=iOS 4.0 , all images taken from the camera contain EXIF -based rotation information. What's not working: After trying different image cropping techniques, all I end up with is cropping of the image at some random corners and also, the

iOS: Cropping a still image grabbed from a UIImagePickerController camera with overlay

女生的网名这么多〃 提交于 2019-12-20 15:33:09
问题 I am new to iOS and I have been bashing head against the wall for this for the past week looking around online for tutorials such as: Dealing with Exif Images, Resizing images, and many more random questions here on StackOverflow. From these, I figured that >=iOS 4.0 , all images taken from the camera contain EXIF -based rotation information. What's not working: After trying different image cropping techniques, all I end up with is cropping of the image at some random corners and also, the

R: Crop GeoTiff Raster using packages “rgdal” and “raster”

二次信任 提交于 2019-12-20 14:45:18
问题 I'd like to crop GeoTiff Raster Files using the two mentioned packages, "rgdal" and "raster". Everything works fine, except that the quality of the resulting output tif is very poor and in greyscale rather than colour. The original data are high quality raster maps from the swiss federal office of Topography, example files can be downloaded here. This is my code: ## install.packages("rgdal") ## install.packages("raster") library("rgdal") library("raster") tobecroped <- raster("C:/files/krel

Freehand Image Crop draw inside bitmap region

北战南征 提交于 2019-12-20 14:39:07
问题 Trying to achieve freehand cropping of an image, so I'm able to draw on the image. But it goes outside bitmap region. I just wanna restrict that user can only draw inside bitmap region, check below screen shot. I am trying to implement functionality like Photoshop lasso tool. Its drawing outside view region, which generates incorrect output. Output Code@ onDraw public void onDraw(Canvas canvas) { final Rect rect = new Rect(0, 0, bitmap.getWidth(), bitmap.getHeight()); canvas.drawBitmap(bitmap

Command line batch image cropping tool

别来无恙 提交于 2019-12-20 08:59:16
问题 is there any lightweight command line batch image cropping tool(Linux or Windows) which can handle a variety of the formats ? 回答1: Imagemagick is what you want -- tried and true. 回答2: In Linux you can use mogrify -crop {Width}x{Height}+{X}+{Y} +repage image.png for CLI image manipulation 回答3: Imagemagick's convert does the trick for me (and much more than cropping): convert -crop +100+10 in.jpg out.jpg crops 100 pixels off the left border, 10 pixels from the top. convert -crop -100+0 in.jpg