Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dieghernan committed Jul 19, 2024
1 parent e1e89e0 commit 2f92099
Show file tree
Hide file tree
Showing 8 changed files with 54 additions and 61 deletions.
Binary file modified R/sysdata.rda
Binary file not shown.
6 changes: 2 additions & 4 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ results](https://badges.cranchecks.info/worst/resmush.svg)](https://cran.r-proje
[![R-CMD-check](https://github.com/dieghernan/resmush/actions/workflows/check-full.yaml/badge.svg)](https://github.com/dieghernan/resmush/actions/workflows/check-full.yaml)
[![R-hub](https://github.com/dieghernan/resmush/actions/workflows/rhub.yaml/badge.svg)](https://github.com/dieghernan/resmush/actions/workflows/rhub.yaml)
[![codecov](https://codecov.io/gh/dieghernan/resmush/graph/badge.svg)](https://app.codecov.io/gh/dieghernan/resmush)
[![r-universe](https://dieghernan.r-universe.dev/badges/resmush)](https://dieghernan.r-universe.dev/resmush)
[![CodeFactor](https://www.codefactor.io/repository/github/dieghernan/resmush/badge)](https://www.codefactor.io/repository/github/dieghernan/resmush)
[![DOI](https://img.shields.io/badge/DOI-10.32614/CRAN.package.resmush-blue)](https://doi.org/10.32614/CRAN.package.resmush)
[![Project Status: Active -- The project has reached a stable, usable state and
Expand Down Expand Up @@ -79,8 +78,7 @@ You can install the development version of **resmush** from
remotes::install_github("dieghernan/resmush")
```

Alternatively, you can install **resmush** using the
[r-universe](https://dieghernan.r-universe.dev/resmush):
Alternatively, you can install **resmush** using the **r-universe+**:

```{r, eval=FALSE}
# Install resmush in R:
Expand Down Expand Up @@ -178,7 +176,7 @@ There are other alternatives for optimizing images with **R**:
installed locally.

| tool | CRAN | Additional software? | Online? | API Key? | Limits? |
|--------------|--------------|--------------|--------------|--------------|--------------|
|-------------------|------|----------------------|---------|----------|-----------------------------|
| `xfun::tinify()` | Yes | No | Yes | Yes | 500 files/month (Free tier) |
| `xfun::optipng()` | Yes | Yes | No | No | No |
| **tinieR** | No | No | Yes | Yes | 500 files/month (Free tier) |
Expand Down
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ results](https://badges.cranchecks.info/worst/resmush.svg)](https://cran.r-proje
[![R-CMD-check](https://github.com/dieghernan/resmush/actions/workflows/check-full.yaml/badge.svg)](https://github.com/dieghernan/resmush/actions/workflows/check-full.yaml)
[![R-hub](https://github.com/dieghernan/resmush/actions/workflows/rhub.yaml/badge.svg)](https://github.com/dieghernan/resmush/actions/workflows/rhub.yaml)
[![codecov](https://codecov.io/gh/dieghernan/resmush/graph/badge.svg)](https://app.codecov.io/gh/dieghernan/resmush)
[![r-universe](https://dieghernan.r-universe.dev/badges/resmush)](https://dieghernan.r-universe.dev/resmush)
[![CodeFactor](https://www.codefactor.io/repository/github/dieghernan/resmush/badge)](https://www.codefactor.io/repository/github/dieghernan/resmush)
[![DOI](https://img.shields.io/badge/DOI-10.32614/CRAN.package.resmush-blue)](https://doi.org/10.32614/CRAN.package.resmush)
[![Project Status: Active – The project has reached a stable, usable
Expand Down Expand Up @@ -61,8 +60,7 @@ You can install the development version of **resmush** from
remotes::install_github("dieghernan/resmush")
```

Alternatively, you can install **resmush** using the
[r-universe](https://dieghernan.r-universe.dev/resmush):
Alternatively, you can install **resmush** using the **r-universe+**:

``` r
# Install resmush in R:
Expand Down
2 changes: 1 addition & 1 deletion codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@
"SystemRequirements": null
},
"keywords": ["r", "compress-images", "optimize-images", "resmushit", "api", "r-package"],
"fileSize": "677.416KB",
"fileSize": "676.942KB",
"citation": [
{
"@type": "SoftwareSourceCode",
Expand Down
12 changes: 8 additions & 4 deletions data-raw/res_example.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,14 @@ jpg_url <- paste0(
all_in <- c(png_url, notval, jpg_url, turl)

res_example <- resmush_url(all_in)
res_example$dest_img <- gsub("C:\\Users\\diego\\AppData\\Local\\Temp", "",
res_example$dest_img,
fixed = TRUE

# Anonimize folder

res_example$dest_img <- basename(res_example$dest_img)

res_example$dest_img <- ifelse(is.na(res_example$dest_img),
NA, file.path("some_folder", res_example$dest_img)
)
res_example$dest_img


usethis::use_data(res_example, overwrite = TRUE, internal = TRUE)
61 changes: 30 additions & 31 deletions revdep/README.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,37 @@
# Platform

|field |value |
|:--------|:----------------------------------------|
|version |R version 4.4.0 (2024-04-24 ucrt) |
|os |Windows 11 x64 (build 22631) |
|system |x86_64, mingw32 |
|ui |RStudio |
|language |(EN) |
|collate |Spanish_Spain.utf8 |
|ctype |Spanish_Spain.utf8 |
|tz |Europe/Madrid |
|date |2024-05-22 |
|rstudio |2024.04.1+748 Chocolate Cosmos (desktop) |
|pandoc |3.1.12.2 @ C:\PROGRA~1\Pandoc\pandoc.exe |
| field | value |
|:---------|:-------------------------------------------|
| version | R version 4.4.1 (2024-06-14 ucrt) |
| os | Windows 11 x64 (build 22631) |
| system | x86_64, mingw32 |
| ui | RStudio |
| language | (EN) |
| collate | Spanish_Spain.utf8 |
| ctype | Spanish_Spain.utf8 |
| tz | Europe/Madrid |
| date | 2024-07-19 |
| rstudio | 2024.04.2+764 Chocolate Cosmos (desktop) |
| pandoc | 3.1.12.2 \@ C:\PROGRA\~1\Pandoc\pandoc.exe |

# Dependencies

|package |old |new |Δ |
|:---------|:-----|:-----|:--|
|resmush |0.1.0 |0.1.1 |* |
|askpass |1.2.0 |1.2.0 | |
|cli |3.6.2 |3.6.2 | |
|curl |5.2.1 |5.2.1 | |
|glue |1.7.0 |1.7.0 | |
|httr2 |1.0.1 |1.0.1 | |
|lifecycle |1.0.4 |1.0.4 | |
|magrittr |2.0.3 |2.0.3 | |
|openssl |2.2.0 |2.2.0 | |
|R6 |2.5.1 |2.5.1 | |
|rappdirs |0.3.3 |0.3.3 | |
|rlang |1.1.3 |1.1.3 | |
|sys |3.4.2 |3.4.2 | |
|vctrs |0.6.5 |0.6.5 | |
|withr |3.0.0 |3.0.0 | |
| package | old | new | Δ |
|:----------|:------|:------|:----|
| resmush | 0.1.1 | 0.2.0 | \* |
| askpass | 1.2.0 | 1.2.0 | |
| cli | 3.6.3 | 3.6.3 | |
| curl | 5.2.1 | 5.2.1 | |
| glue | 1.7.0 | 1.7.0 | |
| httr2 | 1.0.2 | 1.0.2 | |
| lifecycle | 1.0.4 | 1.0.4 | |
| magrittr | 2.0.3 | 2.0.3 | |
| openssl | 2.2.0 | 2.2.0 | |
| R6 | 2.5.1 | 2.5.1 | |
| rappdirs | 0.3.3 | 0.3.3 | |
| rlang | 1.1.4 | 1.1.4 | |
| sys | 3.4.2 | 3.4.2 | |
| vctrs | 0.6.5 | 0.6.5 | |
| withr | 3.0.0 | 3.0.0 | |

# Revdeps

24 changes: 12 additions & 12 deletions tests/testthat/_snaps/show_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
== resmush summary =============================================================
i Input: 4 files with size 340.2 Kb
v Success for 2 files: Size now is 153.8 Kb (was 340.2 Kb). Saved 186.4 Kb (54.79%).
See results in directory '/RtmpwZ55V8'.
See results in directory 'some_folder'.
x Failed for 2 files in directories 'https://raw.githubusercontent.com/dieghernan/resmush/main' and 'https://dieghernan.github.io'.
i Files not converted:
! 'https://raw.githubusercontent.com/dieghernan/resmush/main/README.md' (NA):
403: Unauthorized extension. Allowed are : JPG, PNG, GIF, BMP, TIFF, WEBP.
403: Unauthorized extension. Allowed are : JPG, PNG, GIF, BMP, TIFF.
! 'https://dieghernan.github.io/aaabbbccc.png' (NA): 401: Cannot copy from
remote url.

Expand All @@ -24,7 +24,7 @@
x Failed for 1 file in directory 'https://raw.githubusercontent.com/dieghernan/resmush/main'.
i File not converted:
! 'https://raw.githubusercontent.com/dieghernan/resmush/main/README.md' (NA):
403: Unauthorized extension. Allowed are : JPG, PNG, GIF, BMP, TIFF, WEBP.
403: Unauthorized extension. Allowed are : JPG, PNG, GIF, BMP, TIFF.

---

Expand All @@ -36,7 +36,7 @@
x Failed for 2 files in directories 'https://raw.githubusercontent.com/dieghernan/resmush/main' and 'https://dieghernan.github.io'.
i Files not converted:
! 'https://raw.githubusercontent.com/dieghernan/resmush/main/README.md' (NA):
403: Unauthorized extension. Allowed are : JPG, PNG, GIF, BMP, TIFF, WEBP.
403: Unauthorized extension. Allowed are : JPG, PNG, GIF, BMP, TIFF.
! 'https://dieghernan.github.io/aaabbbccc.png' (NA): 401: Cannot copy from
remote url.

Expand All @@ -48,7 +48,7 @@
== resmush summary =============================================================
i Input: 1 file with size 239.9 Kb
v Success for 1 file: Size now is 70.7 Kb (was 239.9 Kb). Saved 169.2 Kb (70.54%).
See result in directory '/RtmpwZ55V8'.
See result in directory 'some_folder'.

---

Expand All @@ -58,7 +58,7 @@
== resmush summary =============================================================
i Input: 2 files with size 340.2 Kb
v Success for 2 files: Size now is 153.8 Kb (was 340.2 Kb). Saved 186.4 Kb (54.79%).
See results in directory '/RtmpwZ55V8'.
See results in directory 'some_folder'.

# Report for url

Expand All @@ -68,10 +68,10 @@
== resmush summary =============================================================
i Input: 4 urls with size 340.2 Kb
v Success for 2 urls: Size now is 153.8 Kb (was 340.2 Kb). Saved 186.4 Kb (54.79%).
See results in directory '/RtmpwZ55V8'.
See results in directory 'some_folder'.
x Failed for 2 urls:
! <https://raw.githubusercontent.com/dieghernan/resmush/main/README.md>: 403:
Unauthorized extension. Allowed are : JPG, PNG, GIF, BMP, TIFF, WEBP.
Unauthorized extension. Allowed are : JPG, PNG, GIF, BMP, TIFF.
! <https://dieghernan.github.io/aaabbbccc.png>: 401: Cannot copy from remote
url.

Expand All @@ -84,7 +84,7 @@
i Input: 1 url with size 0 bytes
x Failed for 1 url:
! <https://raw.githubusercontent.com/dieghernan/resmush/main/README.md>: 403:
Unauthorized extension. Allowed are : JPG, PNG, GIF, BMP, TIFF, WEBP.
Unauthorized extension. Allowed are : JPG, PNG, GIF, BMP, TIFF.

---

Expand All @@ -95,7 +95,7 @@
i Input: 2 urls with size 0 bytes
x Failed for 2 urls:
! <https://raw.githubusercontent.com/dieghernan/resmush/main/README.md>: 403:
Unauthorized extension. Allowed are : JPG, PNG, GIF, BMP, TIFF, WEBP.
Unauthorized extension. Allowed are : JPG, PNG, GIF, BMP, TIFF.
! <https://dieghernan.github.io/aaabbbccc.png>: 401: Cannot copy from remote
url.

Expand All @@ -107,7 +107,7 @@
== resmush summary =============================================================
i Input: 1 url with size 239.9 Kb
v Success for 1 url: Size now is 70.7 Kb (was 239.9 Kb). Saved 169.2 Kb (70.54%).
See result in directory '/RtmpwZ55V8'.
See result in directory 'some_folder'.

---

Expand All @@ -117,5 +117,5 @@
== resmush summary =============================================================
i Input: 2 urls with size 340.2 Kb
v Success for 2 urls: Size now is 153.8 Kb (was 340.2 Kb). Saved 186.4 Kb (54.79%).
See results in directory '/RtmpwZ55V8'.
See results in directory 'some_folder'.

6 changes: 0 additions & 6 deletions tests/testthat/test-show_report.R
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
test_that("Report for local", {
skip_on_cran()
skip_on_os("mac")
skip_on_os("linux")
skip_on_os("solaris")

test_f <- res_example
# Full
Expand All @@ -23,9 +20,6 @@ test_that("Report for local", {

test_that("Report for url", {
skip_on_cran()
skip_on_os("mac")
skip_on_os("linux")
skip_on_os("solaris")

test_f <- res_example
# Full
Expand Down

0 comments on commit 2f92099

Please sign in to comment.