# FileTransformFactory

Artifact: [androidx.camera:camera-view](https://developer.android.com/jetpack/androidx/releases/camera) [View Source](https://cs.android.com/search?q=file:androidx/camera/view/transform/FileTransformFactory.java+class:androidx.camera.view.transform.FileTransformFactory) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/camera#1.1.0)

*** ** * ** ***


```
class FileTransformFactory
```

<br />

*** ** * ** ***

Factory for extracting transform info from image files.

This class is for extracting a `https://developer.android.com/reference/kotlin/androidx/camera/view/transform/OutputTransform` from an image file saved by `https://developer.android.com/reference/kotlin/androidx/camera/core/ImageCapture`. The `https://developer.android.com/reference/kotlin/androidx/camera/view/transform/OutputTransform` represents the transform being applied to the original camera buffer, which can be used by `https://developer.android.com/reference/kotlin/androidx/camera/view/transform/CoordinateTransform` to transform coordinates between `https://developer.android.com/reference/kotlin/androidx/camera/core/UseCase`s.

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/camera/view/transform/OutputTransform` |   |
| `https://developer.android.com/reference/kotlin/androidx/camera/view/transform/CoordinateTransform` |   |

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/camera/view/transform/FileTransformFactory#FileTransformFactory()()` |

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/camera/view/transform/OutputTransform` | `https://developer.android.com/reference/kotlin/androidx/camera/view/transform/FileTransformFactory#getOutputTransform(java.io.File)(file: https://developer.android.com/reference/java/io/File.html)` Extracts transform info from the given `https://developer.android.com/reference/java/io/File.html`. |
| `https://developer.android.com/reference/kotlin/androidx/camera/view/transform/OutputTransform` | `https://developer.android.com/reference/kotlin/androidx/camera/view/transform/FileTransformFactory#getOutputTransform(java.io.InputStream)(inputStream: https://developer.android.com/reference/java/io/InputStream.html)` Extracts transform info from the given `https://developer.android.com/reference/java/io/InputStream.html`. |
| `https://developer.android.com/reference/kotlin/androidx/camera/view/transform/OutputTransform` | `https://developer.android.com/reference/kotlin/androidx/camera/view/transform/FileTransformFactory#getOutputTransform(android.content.ContentResolver,android.net.Uri)(contentResolver: https://developer.android.com/reference/android/content/ContentResolver.html, uri: https://developer.android.com/reference/android/net/Uri.html)` Extracts transform info from the given `https://developer.android.com/reference/android/net/Uri.html`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/camera/view/transform/FileTransformFactory#isUsingExifOrientation()()` Whether the factory respects the exif of the image file. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/camera/view/transform/FileTransformFactory#setUsingExifOrientation(boolean)(usingExifOrientation: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` Whether to include the `https://developer.android.com/reference/android/media/ExifInterface.html#TAG_ORIENTATION`. |

## Public constructors

### FileTransformFactory

Added in 1.1.0

```
FileTransformFactory()
```

## Public functions

### getOutputTransform

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/camera#1.1.0)

```
fun getOutputTransform(file: File): OutputTransform
```

Extracts transform info from the given `https://developer.android.com/reference/java/io/File.html`.

| Throws |
|---|---|
| `https://developer.android.com/reference/java/io/IOException.html` |   |

### getOutputTransform

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/camera#1.1.0)

```
fun getOutputTransform(inputStream: InputStream): OutputTransform
```

Extracts transform info from the given `https://developer.android.com/reference/java/io/InputStream.html`.

| Throws |
|---|---|
| `https://developer.android.com/reference/java/io/IOException.html` |   |

### getOutputTransform

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/camera#1.1.0)

```
fun getOutputTransform(contentResolver: ContentResolver, uri: Uri): OutputTransform
```

Extracts transform info from the given `https://developer.android.com/reference/android/net/Uri.html`.

| Throws |
|---|---|
| `https://developer.android.com/reference/java/io/IOException.html` |   |

### isUsingExifOrientation

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/camera#1.1.0)

```
fun isUsingExifOrientation(): Boolean
```

Whether the factory respects the exif of the image file.

### setUsingExifOrientation

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/camera#1.1.0)

```
fun setUsingExifOrientation(usingExifOrientation: Boolean): Unit
```

Whether to include the `https://developer.android.com/reference/android/media/ExifInterface.html#TAG_ORIENTATION`. By default, this value is false, e.g. loading image with `https://developer.android.com/reference/android/graphics/BitmapFactory.html` does not apply the exif orientation to the loaded `https://developer.android.com/reference/android/graphics/Bitmap.html`. Only set this if the exif orientation is applied to the loaded file. For example, if the image is loaded by a 3P library that automatically applies exif orientation.