-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
PSPDFKit
committed
Dec 19, 2023
1 parent
5b2716a
commit 3c6ec7b
Showing
135 changed files
with
58,774 additions
and
14,665 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
android/src/main/java/com/pspdfkit/react/helper/PSPDFKitUtils.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package com.pspdfkit.react.helper | ||
|
||
import java.io.File | ||
import java.util.Locale | ||
|
||
|
||
class PSPDFKitUtils { | ||
companion object { | ||
|
||
private val SUPPORTED_IMAGE_TYPES = arrayOf( | ||
".jpg", | ||
".png", | ||
".jpeg", | ||
".tif", | ||
".tiff" | ||
) | ||
|
||
@JvmStatic | ||
public fun isValidImage(file: File): Boolean { | ||
for (extension in SUPPORTED_IMAGE_TYPES) { | ||
if (file.name.lowercase(Locale.getDefault()).endsWith(extension)) { | ||
return true | ||
} | ||
} | ||
return false | ||
} | ||
|
||
@JvmStatic | ||
public fun isValidPdf(file: File): Boolean { | ||
return file.name.lowercase(Locale.getDefault()).endsWith(".pdf") | ||
} | ||
} | ||
} |
Oops, something went wrong.