# sips/magick cmd to build "safe" jpg files for html5?

**URL:** <https://forums.solar2d.com/t/sips-magick-cmd-to-build-safe-jpg-files-for-html5/357793>\
**Category:** HTML5\
**Created:** [May 1, 2026, 9:20pm UTC](https://forums.solar2d.com/t/sips-magick-cmd-to-build-safe-jpg-files-for-html5/357793 "2026-05-01T21:20:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sieler2](https://forums.solar2d.com/user_avatar/forums.solar2d.com/sieler2/32/84_2.png) [@sieler2](https://forums.solar2d.com/u/sieler2)\
**Post date:** [May 1, 2026, 9:20pm UTC](https://forums.solar2d.com/t/sips-magick-cmd-to-build-safe-jpg-files-for-html5/357793/1 "2026-05-01T21:20:00Z")

</div>

Hi,

TL;DR: does anyone have a sips or magickt command that will “fix” bad JPG files so they can be displayed via Solar2D generated HTML apps?

Most of my jpg files display ok, but a few don’t (looks like a TV set with random noise signal) . The bad ones were hand created in macOS “Paintbrush” as simply black squares with ASCII text (a number). After tracing my display problem, I can summarize with these two jpg files: (info from: “file \*.jpg”)

bad.jpg: JPEG image data, JFIF standard 1.01, aspect ratio, density 1x1, segment length 16, Exif Standard: [TIFF image data, big-endian, direntries=1], baseline, precision 8, 275x452, components 1

good.jpg: JPEG image data, JFIF standard 1.01, aspect ratio, density 72x72, segment length 16, Exif Standard: [TIFF image data, big-endian, direntries=1], baseline, precision 8, 271x452, components 3

And, more detailed “diff” of exif differences:

```auto
2c2
< File Name : bad.jpg
---
> File Name : good.jpg
4,7c4,7
---
16,17d15
19c17
< Exif Image Width : 452
---
> Exif Image Width : 271
20a19,20
22c22
< Profile Version : 2.0.0
---
> Profile Version : 2.2.0
24c24
< Color Space Data : GRAY
---
> Color Space Data : RGB
26c26
---
30c30
< Device Manufacturer : none
---
> Device Manufacturer : appl
37,72c37,78
< Profile Description : Generic Gray Gamma 2.2 Profile
< Profile Description ML : Generic Gray Gamma 2.2 Profile
< Profile Copyright : Copyright Apple Inc., 2012
< Media White Point : 0.95045 1 1.08905
< Gray Tone Reproduction Curve : (Binary data 2060 bytes, use -b option to extract)
< Image Width : 275
---
> Profile Description : Generic RGB Profile
> Profile Description ML : Generic RGB Profile
> Profile Copyright : Copyright 2007 Apple Inc., all rights reserved.
> Media White Point : 0.95047 1 1.0891
> Red Matrix Column : 0.4543 0.24191 0.01489
> Green Matrix Column : 0.35335 0.67363 0.09064
> Blue Matrix Column : 0.15665 0.08446 0.71957
> Red Tone Reproduction Curve : (Binary data 14 bytes, use -b option to extract)
> Chromatic Adaptation : 1.04788 0.02292 -0.0502 0.02957 0.99049 -0.01706 -0.00923 0.01508 0.75165
> Blue Tone Reproduction Curve : (Binary data 14 bytes, use -b option to extract)
> Green Tone Reproduction Curve : (Binary data 14 bytes, use -b option to extract)
> Image Width : 271
76,78c82,85
< Color Components : 1
< Image Size : 275x452
< Megapixels : 0.124
---
> Color Components : 3
> Y Cb Cr Sub Sampling : YCbCr4:2:0 (2 2)
> Image Size : 271x452
> Megapixels : 0.122

```

thanks!

Stan

---

<div class="post-metadata">

**Author:** ![Kan98](https://forums.solar2d.com/user_avatar/forums.solar2d.com/kan98/32/2224_2.png) [@Kan98](https://forums.solar2d.com/u/Kan98)\
**Post date:** [May 2, 2026, 3:29am UTC](https://forums.solar2d.com/t/sips-magick-cmd-to-build-safe-jpg-files-for-html5/357793/2 "2026-05-02T03:29:34Z")

</div>

It could also be related to this issue; the HTML build is having problems with JPG/JPEG.

> <https://github.com/coronalabs/corona/issues/875>
>
> In the latest Solar2D version, loading JPG images in HTML5 causes the app to fre…eze with a runtime error.
> I confirmed this using a minimal blank project that only loads a single JPG image. The issue happens consistently in HTML5, while the same code works correctly in the Solar2D simulator.
> 
> \*\*To Reproduce\*\*
> 1. Create a new blank Solar2D project
> 2. Add any JPG image
> 3. Load it using:
> display.newImageRect("image.jpg", width, height)
> 4. Build and run for HTML5
> 
> \*\*Expected behavior:\*\*
> The image loads and the app continues normally.
> 
> \*\*Actual behavior:\*\*
> 
> \- App freezes after splash screen
> \- Loading bar stuck
> \- Screen visually corrupted
> \- Chrome console shows:
> Uncaught RuntimeError: function signature mismatch
> 
> \*\*Additional notes\*\*
> 
> \- Works correctly in the Solar2D simulator
> \- Reproducible in a minimal project
> \- Replacing the image with display.newRect avoids the issue
> \- Appears to be a regression in the current HTML5 runtime
> 
> I’ve attached a minimal test project that reproduces the issue from a clean Solar2D setup.
> The project does nothing else besides loading a JPG image using display.newImageRect, and it fails consistently when built for HTML5.
> 
> \[test2.zip\](https://github.com/user-attachments/files/24472310/test2.zip)
> 
> \*\*UPDATE:\*\*
> I have tested Solar2D 2025.3726, and the issue also persists in this version.
> The last version I was using before testing 2026.3727 and 2025.3726 was 2025.3724, and this bug did not occur in that version.
> I only need to test 3725 to determine whether this is the version in which the bug was introduced.
> 
> Tested with version 3725, and the bug occurs there as well.
> 
> I’m not sure what is happening, but currently it’s not possible to display a JPG image even in the version where this issue did not occur before (2025.3724). I don’t know how the Corona software update process works internally. Every time I update to a newer version, I always uninstall the previous one first; I do this because on one occasion, when I updated in the conventional way (without uninstalling the previous version), I encountered an error.
> 
> Before trying newer versions, version 3724 was able to correctly display one of my games that loads a JPG image. However, after testing the three subsequent versions and being unable to get it to work, I reverted to version 3724, and now the same bug is also present in that version.

---

<div class="post-metadata">

**Author:** ![sieler2](https://forums.solar2d.com/user_avatar/forums.solar2d.com/sieler2/32/84_2.png) [@sieler2](https://forums.solar2d.com/u/sieler2)\
**Post date:** [May 5, 2026, 8:26pm UTC](https://forums.solar2d.com/t/sips-magick-cmd-to-build-safe-jpg-files-for-html5/357793/3 "2026-05-05T20:26:03Z")

</div>

My workaround was to generate new .jpgs for the pictures I needed, using a different tool. Tedious, but the new files worked.
