@bsky.app/expo-image-crop-tool

中文文档
0.5.1发布于 2026/05/04MITTypeScriptCommonJS零依赖构建来源已验证近 30 天下载 8.1万

An image cropper for Expo

原始使用文档
文档目录4 节
  1. Add the package to your npm dependencies
  2. openCropperAsync(options: OpenCropperOptions) => Promise<Op…
  3. OpenCropperOptions
  4. OpenCropperResult

Expo Image Crop Tool

An image cropping tool for Expo that allows cropping of the given image. Can be used alongside a library like expo-image-picker to provide a more fully-featured cropping experience for users.

Installation in managed Expo projects

For managed Expo projects, please follow the installation instructions in the API documentation for the latest stable release. If you follow the link and there is no documentation available then this library is not yet usable within managed projects — it is likely to be included in an upcoming Expo SDK release.

Installation in bare React Native projects

For bare React Native projects, you must ensure that you have installed and configured the expo package before continuing.

Add the package to your npm dependencies

npm install @bsky.app/expo-image-crop-tool
cd ios
pod install

[!NOTE] This package was previously published as expo-image-crop-tool, but is now called @bsky.app/expo-image-crop-tool.

Usage

For basic examples, see example/App.tsx.

openCropperAsync(options: OpenCropperOptions) => Promise<OpenCropperResult>

openCropperAsync will return the path to the cropped image, or will throw an error if something goes wrong.

OpenCropperOptions

KeyTypeiOSAndroidDescription
imageUristring✅✅A path to the image that you want to crop.
shapestring✅✅The shape that you want the returned image to be ('rectangle' | 'circle'). Default is rectangle.
aspectRationumber✅✅If you want to force a particular aspect ratio for the output image.
formatstring✅✅The format of the output image ('png' | 'jpeg'). Default is png.
compressImageQualitynumber✅✅If outputting a JPEG image, the compression quality for the output image.
rotationEnabledboolean✅✅Whether or not to allow the user to rotate the image in 90 degree segments. Default is true.
rotationControlEnabledboolean✅Whether or not to show the rotation control view. Default is true.
cancelButtonTextstring✅✅Custom text for the Cancel button.
doneButtonTextstring✅✅Custom text for the Done button.

OpenCropperResult

KeyTypeDescription
pathstringPath of the output image
sizenumberSize in bytes of the output image
widthnumberWidth of the output image
heightnumberHeight of the output image
mimeTypestringMIME type of the output image

版本与发布记录

@bsky.app/expo-image-crop-tool 共发布 2 个版本,首次发布于 2026/01/06;过去 12 个月发布了 2 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.5.1latest2026/05/046 个月前
0.5.02026/01/0610 个月前

关于 @bsky.app/expo-image-crop-tool 的常见问题

@bsky.app/expo-image-crop-tool 是什么?

An image cropper for Expo

如何安装 @bsky.app/expo-image-crop-tool?

在项目目录运行 npm install @bsky.app/expo-image-crop-tool,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:expo(*)、react(*)、react-native(*)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@bsky.app/expo-image-crop-tool 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@bsky.app/expo-image-crop-tool 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@bsky.app/expo-image-crop-tool 可以商用吗?

@bsky.app/expo-image-crop-tool 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@bsky.app/expo-image-crop-tool 的下载量有多少?

根据 npm 官方下载统计,@bsky.app/expo-image-crop-tool 在 2026/10/09 – 2026/11/07 这 30 天内被下载 81,277 次,日均约 2,709 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@bsky.app/expo-image-crop-tool 还在维护吗?

最新版本 0.5.1 发布于 2026/05/04(6 个月前);至今共发布 2 个版本,其中过去 12 个月发布了 2 个;首次发布于 2026/01/06。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。