crop

rails carrierwave - image url saved in db but file not saved

♀尐吖头ヾ 提交于 2019-12-11 23:29:51
问题 I have a form where I use cropit.js to crop an image. Button is onclick calling jquery function which takes result of cropit (cropped image) and with ajax push it to controller. Here it seems to work, but when I do this, everything looks ok, I dont see any error but the result is that url is stored in database with file name, but file itself is not stored in default uploads directory here is my model class Project < ActiveRecord::Base mount_uploader :profile_pic, ProjectProfileUploader end

Finding a line in an image file

若如初见. 提交于 2019-12-11 23:02:28
问题 I am trying to crop out the printer marks that are at the edges of a PDF. The path i want to take to solve this problem is as follows: Convert PDF into a bitmap and then traverse the bitmap and try to find the lines, then once the lines are found, find the coordinates of the edges of these lines, set the cropping coordinates to the coordinates just found. However the problems that pop up in my mind with this approach is how to know when the lines end and the actual page starts. How to

Android - Cropped image so much zoomed and looking blurre

﹥>﹥吖頭↗ 提交于 2019-12-11 18:44:24
问题 I am using following code to crop an image taken from the camera: Intent intent = new Intent("com.android.camera.action.CROP"); intent .setDataAndType(outputFileUri, "image/*"); intent.putExtra("outputX",600); intent.putExtra("outputY", 600); intent.putExtra("aspectX", 1); intent.putExtra("aspectY", 1); intent.putExtra("scale", true); intent.putExtra("return-data", false); startActivityForResult(intent, 2); My problems are: Image cropping is working good on some devices and on some devices

How to truly crop a PDF file?

早过忘川 提交于 2019-12-11 18:05:25
问题 I am trying to extract and save a certain portion of a PDF file using specific coordinates (x,y,w,h). I am using the following code, which seems to be working okay: Function CroppedPdf(Source As Byte(), PageNumber As Integer, Rect As System.Drawing.Rectangle) As MemoryStream Dim reader As New PdfReader(Source) Dim h = reader.GetPageSize(1).Height Dim document = New iTextSharp.text.Document(New iTextSharp.text.Rectangle( Rect.Right / 300 * 72, h - (Rect.Top / 300 * 72), Rect.Left / 300 * 72, h

How to transform a videoview into a circular shape?

非 Y 不嫁゛ 提交于 2019-12-11 16:38:49
问题 I want to play a video in full screen in a videoview and after some time I want to crop to a circular view ? How can I achieve that ? 回答1: Another way is put this type of image overlay on your videoview Relative or FrameLayout (Circuler is transprent so videoview will visible only in circle) By default make visibility GONE this imageView and Change VISIBLE it runtime when you want. MAY BE HELPFUL TO YOU 回答2: There is a better way. You can create a custom SurfaceView. Which actually clips the

UIImage showing blur after cropping in iPhone

[亡魂溺海] 提交于 2019-12-11 15:26:12
问题 I my app, i have one uiscrollview and have subview uiimageview on it, when user clicks any photo from library it display on that imageview, user can move,zoom and scale the image, when user clicks crops button it should crop that part which is in imageview, in iPhone 3GS its working perfectly fine, however in retina it not working correctly cropping is showing different image. - (UIImage *)currentSlice { CGSize sliceSize = imageView.frame.size; UIGraphicsBeginImageContextWithOptions(sliceSize

How to crop multi images use list bounding box position in the file (python)?

泪湿孤枕 提交于 2019-12-11 13:18:43
问题 I have a dataset of images.jpg and a file csv has values bounding box position is top, left, right, bottom. I use ubuntu OS and the python language. 回答1: Something like this should work. It assumes a few things: that the separator in your CSV is a semi-colon, i.e. ; that your CSV file is called images.csv that you want the cropped images output to a sub-directory called output that you have PIL/Pillow installed, though it could easily be adapted to use pyvips , OpenCV , skimage #!/usr/bin/env

Windows Phone - Crop BitmapImage [closed]

徘徊边缘 提交于 2019-12-11 12:48:36
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 6 years ago . I have BitmapImage and I need to crop it to a rectangle of size 200x200. The rectangle should contain the center of the source

How to crop a Bitmap with a minimum usage of memory?

点点圈 提交于 2019-12-11 12:24:49
问题 In my app I'm loading plenty of images from the web. That's working fine so far: @Override public void onSuccess( byte[] response ) { Bitmap image = BitmapFactory.decodeByteArray( response, 0, response.length, options ); ... } But in fact it would be nice to use only an extract of the image during the application process. So I tried something like this: @Override public void onSuccess( byte[] response ) { Bitmap source = BitmapFactory.decodeByteArray( response, 0, response.length, options );

wordpress post-thumbnail crop question. is this even possible?

こ雲淡風輕ζ 提交于 2019-12-11 08:48:57
问题 When I'm using the post thumbnail feature in wp3 and set the thumbnail size to e.g. 230x160 wp crops the image from the top left corner to the set size. Sometimes this is sadly just the wrong part of the image. Is there any way to give the backend user the chance to choose the part of the original image which should be the thumbnail? Like a jQuery script or something? Right now I'm using a custom field workaround to upload a second image with the excact dimensions... Any ideas on this? //EDIT