Skip to content

Commit beb3d76

Browse files
committed
High-level summary of the changes: This diff primarily focuses on **removing experimental Cloud OCR features and related documentation**, while also cleaning up and consolidating project resources.
**Key Changes:** - **OCR Removal:** Removed all references, documentation, and code examples related to the experimental Cloud OCR functionality (Gemini, OpenAI, Claude, Azure, Ollama) across the README, API references, and changelogs. - **Documentation Cleanup:** - Deleted the entire `.pages/` directory, including the standalone HTML documentation site, sitemap, and robots.txt. - Updated the main README to point to `imagepickerkmp.dev` instead of the GitHub Pages URL. - Removed specific OCR-related sections from `API_REFERENCE.md` and `CHANGELOG.md` (both English and Spanish versions). - **Library Updates:** - Replaced the deprecated `ByteArray.encodeBase64()` (Ktor utility) with the Kotlin standard library's `Base64.Default.encode()`. - Removed mentions of PDF support specifically within the OCR context, though general PDF selection via the gallery remains. - **Android Configuration:** Retained and clarified the `AndroidGalleryConfig` for controlling picker behavior (gallery vs. file explorer).
1 parent a5bca87 commit beb3d76

9 files changed

Lines changed: 3 additions & 2984 deletions

File tree

.pages/index.html

Lines changed: 0 additions & 2187 deletions
This file was deleted.

.pages/robots.txt

Lines changed: 0 additions & 8 deletions
This file was deleted.

.pages/sitemap.xml

Lines changed: 0 additions & 127 deletions
This file was deleted.

README.es.md

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -474,14 +474,6 @@ GalleryPickerLauncher(
474474
mimeTypes = listOf(MimeType.IMAGE_JPEG, MimeType.IMAGE_PNG)
475475
)
476476

477-
// ✅ Abre EXPLORADOR DE ARCHIVOS automáticamente
478-
ImagePickerLauncherOCR(
479-
config = ImagePickerOCRConfig(
480-
allowedMimeTypes = listOf(MimeType.APPLICATION_PDF) // PDF + OCR ahora funciona!
481-
)
482-
)
483-
```
484-
485477
### Extracción de Datos EXIF
486478

487479
Para habilitar datos EXIF (metadatos de ubicación, cámara, etc.):
@@ -594,37 +586,3 @@ GalleryPickerLauncher(
594586
<em>¡Dale una estrella ⭐ a este repo si te ayudó!</em>
595587
</p>
596588

597-
### 🤖 Experimental Cloud OCR
598-
Need to extract text from images or documents? Try the new experimental OCR functionality:
599-
600-
```kotlin
601-
@OptIn(ExperimentalOCRApi::class)
602-
ImagePickerLauncherOCR(
603-
config = ImagePickerOCRConfig(
604-
provider = GeminiOCRProvider(apiKey = "your-gemini-api-key"),
605-
requestConfig = OCRRequestConfig(
606-
scanMode = ScanMode.TEXT_EXTRACTION,
607-
extractionIndicators = ExtractionIndicators(
608-
extractTables = true,
609-
extractText = true,
610-
extractStructure = true
611-
)
612-
)
613-
),
614-
onOCRResult = { result ->
615-
when (result) {
616-
is OCRResult.Success -> {
617-
println("Extracted text: ${result.text}")
618-
println("Tables: ${result.tables}")
619-
}
620-
is OCRResult.Error -> {
621-
println("OCR failed: ${result.message}")
622-
}
623-
}
624-
}
625-
)
626-
```
627-
628-
**Supported Providers**: Gemini, OpenAI, Claude, Azure, Ollama, and custom services.
629-
630-
---

README.md

Lines changed: 1 addition & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Built with **Compose Multiplatform**, designed for **simplicity, performance, an
4343
---
4444

4545
<p align="center">
46-
<a href="https://ismoy.github.io/ImagePickerKMP/">
46+
<a href="https://imagepickerkmp.dev/">
4747
<img src="https://img.shields.io/badge/%20Full%20Documentation-Visit%20Docs%20Site-0ea5e9?style=for-the-badge&logoColor=white" alt="Documentation Site">
4848
</a>
4949
&nbsp;
@@ -470,112 +470,6 @@ ImagePickerLauncher(
470470
)
471471
```
472472

473-
### Experimental Cloud OCR
474-
Need to extract text from images or documents? Try the new experimental OCR functionality:
475-
476-
```kotlin
477-
var isOCRActive = remember { mutableStateOf(false) }
478-
var resultOCR by remember { mutableStateOf<OCRResult?>(null) }
479-
@OptIn(ExperimentalOCRApi::class)
480-
if (isOCRActive) {
481-
ImagePickerLauncherOCR(
482-
config = ImagePickerOCRConfig(
483-
scanMode = ScanMode.Cloud(
484-
provider = CloudOCRProvider.Gemini("${your_gemini_api_key}")
485-
),
486-
onOCRCompleted = { result ->
487-
resultOCR = result
488-
isOCRActive=false
489-
},
490-
onError = {
491-
isOCRActive =false
492-
println("OCR error: $it")
493-
},
494-
onCancel = {
495-
isOCRActive =false
496-
},
497-
directCameraLaunch = false // IOS,
498-
allowedMimeTypes =listOf(MimeType.APPLICATION_PDF, MimeType.IMAGE_ALL),
499-
)
500-
)
501-
}
502-
503-
Button(onClick{
504-
isOCRActive =true
505-
}){
506-
Text("Click me")
507-
}
508-
```
509-
### More Options
510-
511-
#### SCustom OCR service with simple authentication:
512-
```kotlin
513-
CloudOCRProvider.Custom(
514-
name = "MyCompany OCR",
515-
baseUrl = "https://api.mycompany.com/ocr/analyze",
516-
apiKey = "abc123def456",
517-
requestFormat = RequestFormat.MULTIPART_FORM
518-
)
519-
```
520-
521-
#### Service without authentication (local or public):
522-
```kotlin
523-
CloudOCRProvider.Custom(
524-
name = "Local OCR Server",
525-
baseUrl = "http://localhost:8080/api/ocr",
526-
apiKey = null, // No API key required
527-
requestFormat = RequestFormat.JSON
528-
)
529-
```
530-
531-
#### Service with custom headers:
532-
```kotlin
533-
CloudOCRProvider.Custom(
534-
name = "Enterprise OCR Service",
535-
baseUrl = "https://enterprise-ocr.internal.com/v2/extract",
536-
headers = mapOf(
537-
"X-API-Version" to "2.1",
538-
"X-Client-ID" to "mobile-app",
539-
"Authorization" to "Bearer $token",
540-
"User-Agent" to "ImagePickerKMP/1.0"
541-
),
542-
requestFormat = RequestFormat.MULTIPART_FORM,
543-
model = "enterprise-model-v3"
544-
)
545-
```
546-
#### Service using JSON request format:
547-
```kotlin
548-
CloudOCRProvider.Custom(
549-
name = "JSON OCR API",
550-
baseUrl = "https://api.json-ocr.com/v1/process",
551-
apiKey = "json-api-key-123",
552-
headers = mapOf(
553-
"Content-Type" to "application/json"
554-
),
555-
requestFormat = RequestFormat.JSON
556-
)
557-
```
558-
### `RequestFormat` Options
559-
- **RequestFormat.MULTIPART_FORM**: For APIs expecting `multipart/form-data`.
560-
- **RequestFormat.JSON**: For APIs expecting JSON with a Base64-encoded image.
561-
562-
---
563-
564-
### Fields available in `CloudOCRProvider.Custom`
565-
- **name**: Descriptive name of your OCR service.
566-
- **baseUrl**: Base URL of your OCR API.
567-
- **apiKey** (optional): API key, may be `null`.
568-
- **headers** (optional): Custom HTTP headers.
569-
- **requestFormat**: Request format (`MULTIPART_FORM` or `JSON`).
570-
- **model** (optional): Specific model to use.
571-
572-
573-
574-
**Supported Providers**: Gemini, OpenAI, Claude, Azure, Ollama, and custom services.
575-
576-
---
577-
578-
579473
## React/Web Integration
580474

581475
ImagePickerKMP is available as an NPM package for web development:

0 commit comments

Comments
 (0)