`
RandyWei
  • 浏览: 67091 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

Cropped image not returned on Motorola Droid

 
阅读更多

Cropped image not returned on Motorola Droid

Hello, I have written some code to get a cropped image from the phone which I've tested and is working on both the Android emulator and on the G1 hardware. The behavior is different on the Motorola Droid so I could use some help figuring this out.

 

I'm creating an intent to get the cropped image with this code segment:

 

Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
intent.setType("image/*");
intent.putExtra("crop", "true");
intent.putExtra("outputX",         width);
intent.putExtra("outputY",         height);
intent.putExtra("aspectX",         width);
intent.putExtra("aspectY",         height);
intent.putExtra("scale",           true);
intent.putExtra("noFaceDetection", true);
intent.putExtra("setWallpaper",    false);
intent.putExtra("return-data", true);

 

 

I'm then calling startActivityForResult() passing the intent. This brings up the gallery browser on the phone alowing me to select an image and it will go into crop mode. This all works consistenlty across devices.

 

The difference is what happens after I've clicked Save after selecting my crop region. On the Motorola Droid it will simply return back to the gallery browser showing all the images.

 

The expected behavior and what happens in the emulator is my onActivityResult() is called where I then have the following code to grab the bitmap:

 

final Bundle extras = data.getExtras();
Bitmap bitmap = extras.getParcelable("data");

 

I'd appreciate any help as to the differences in the API and if there are changes I need to make to have this work on the Droid.

 

Thank you!

分享到:
评论

相关推荐

    Cropped-image.zip_image crop _matlab 图像裁剪_matlab裁剪区域_区域裁剪 matlab

    例如,`img = imread('Cropped_image.jpg')`会读取名为"Cropped_image.jpg"的图像文件,并将图像数据存储在变量`img`中。 `imcrop`函数则用于裁剪图像。它接受一个图像矩阵和一个矩形区域的坐标作为输入,返回指定...

    A_cropped_image_dataset_for_Chinese_traffic_sign_c_TT100K_

    A_cropped_image_dataset_for_Chinese_traffic_sign_c_TT100K_Cropped

    Ad Oculos Digital Image Processing_cropped2

    这份文档的标题是“Ad Oculos Digital Image Processing_cropped2”,这表明文档是一本关于数字图像处理的教材,Ad Oculos很可能是该教材的名字或者是某种教学辅助工具。从目录内容可以判断,该教材详细地涵盖了数字...

    Laravel开发-image

    $image->save('public/images/cropped_myimage.jpg'); ``` 这里裁剪了图片的50x50像素点为中心的200x200像素的区域。 Laravel 还提供了 Eloquent ORM 的关联方法,可以在处理上传图片时与数据库模型关联。例如,...

    Laravel开发-intervention-image

    $image->save('public/images/cropped_example.jpg'); ``` **2.4 旋转图像** 使用 `rotate()` 方法可按角度旋转图像: ```php $image = Image::make('public/images/example.jpg')->rotate(90); $image->save('...

    JQuery 图片剪切分割上传 - ImageCropper

    console.log('Cropped image data:', data); }, onUpload: function(dataURL) { // Upload cropped image to server uploadToServer(dataURL); } }); ``` ### 5. 注意事项 - 考虑到浏览器兼容性,确保...

    py_cv.tar.gz_ROI_python crop image_python roi

    wxPython GUI with ROI(crop) hover effect, also save main and cropped image with button (right or left click).

    1_imageprocessing_

    cropped_img.save('path_to_cropped_image.jpg') ``` 6. **动态调整大小**:根据描述,可能还会有根据用户需求动态调整裁剪尺寸的逻辑。这可能涉及到计算新尺寸,然后使用`thumbnail`或`resize`方法。 ```python...

    image_process.zip_Reading image

    cropped_img = img.crop((0, 0, img.width // 2, img.height // 2)) # 逆时针旋转90度 rotated_img = img.rotate(90, resample=Image.BICUBIC) ``` 这些只是图像处理的冰山一角。实际应用中,我们还可能涉及到更...

    Crop_Image_opencv_share24l_zip_源码

    6. 可视化裁剪后的图像,`cv2.imshow('Cropped Image', cropped_img)`,并使用`cv2.waitKey()`等待用户按键,然后关闭窗口。 对于Apriori算法的实现,可能包括以下步骤: 1. 加载数据集,这可能来自图像的元数据...

    croppedImage:任何比例中心的裁剪图像

    裁剪图像 任何比例中心的裁剪图像 在 imageview 中,您只能使用CENTER-CROP (0.5,0.5) ,但它在 imageview 上显示图像的中心(0.5,... android : id = " @+id/iv_cropped_land_left " android : scaleType = " matrix

    蛋白质的糖基化作用分类及相关数据库_cropped.doc

    蛋白质的糖基化作用分类及相关数据库_cropped

    umist_cropped.rar_UMIST_UMIST face_UMIST人脸_人脸库mat格式_人脸数据库

    UMIST(University of Manchester Image Database of Faces)是一个著名的人脸数据库,主要由英国曼彻斯特大学的研究团队创建,用于人脸识别领域的研究。这个数据库包含了1444张不同个体的脸部图像,这些图像由不同的...

    cut_image-master.zip

    img = Image.open('image.jpg') ``` 现在我们有了原始图片对象`img`,接下来就是切割的关键步骤。假设我们要将图片切成3行3列的网格,可以使用`img.crop()`方法。这个方法接受一个四元素的元组,表示矩形的左上角和...

    gtea-cropped.zip

    hands mask of GTEA (with GTEA GAZE PLUS) ,1067 labeled frames, each frame of GTEA is 405x720, each frame of GTEA GAZE PLUS is 720x960.

    opencv 入门 图像的裁剪分块

    cv2.imwrite('cropped_image.jpg', cropped_image) ``` 接下来,我们讨论图像的分块。当处理大尺寸图像时,为了提高效率和内存管理,我们可以将图像分割成多个小块。每个小块可以单独处理,然后再组合成整体。以下...

    JavaScript-Load-Image-master.zip

    It returns an optionally scaled and/or cropped HTML img or canvas element. It also provides methods to parse image meta data to extract IPTC and Exif tags as well as embedded thumbnail images and to ...

    1. Basic Image Handling Using OpenCV_imageprocessing_python_

    cropped_img = img[y:y+height, x:x+width] ``` 6. **图像滤波**:OpenCV提供了各种滤波器,如高斯模糊、均值滤波和中值滤波,用于减小噪声或平滑图像: ```python blurred_img = cv2.GaussianBlur(img, ...

    Thinkphp5整合头像上传裁剪旋转

    '/cropped_' . $info->getFilename(); Image::make($path)->fit(100, 100)->save($croppedPath); // 保存裁剪后的路径到数据库 // ... return success('上传成功', ['path' => $croppedPath]); } } ``` 在...

    PHP-jQuery上传图片并裁切

    imagecopyresampled($cropped_image, $image, 0, 0, $x, $y, $width, $height, $width, $height); // 裁切 imagejpeg($cropped_image, 'uploads/cropped_' . basename($target_file)); // 保存裁切后的图片 ...

Global site tag (gtag.js) - Google Analytics