Skip to content

feat(image-utils): rewrite C++ code to better adhere to standards - #61

Merged
jeremy-code merged 4 commits into
mainfrom
dev/cpp
Oct 1, 2026
Merged

jeremy-code merged 4 commits into
mainfrom
dev/cpp

Conversation

@jeremy-code

@jeremy-code jeremy-code commented Oct 1, 2026 •

Copy link
Copy Markdown
Owner

I found the Google C++ style guide: https://google.github.io/styleguide/cppguide.html

  • Add any necessary headers
  • Use C++ std functions when applicable
  • Use naming scheme for constants
  • Rewrite heif_get_exif_data to read the TIFF offset, and then write Exif data using that
  • More consistent code
  • Add error code in WebP codec
  • Instead of early return, create an optional output variable and return that when possible

There is still a lot of malloc/free since I don't want to bring in unnecessary vector code, and if I use string methods, emscripten will return it as a Int8Array. Even if I cast in runtime, I'm not really comfortable with bringing in more string methods into the Wasm bundle since this code is so simple it really shouldn't be necessary.

- Remove "using" directive and instead use emscripten namespace
- Include C/C++ std headers when necessary
- Use std::equal instead of memcpy
- Use std namespace for C std functions
- Use std::optional in more reasonable way
- Rename constants based on C++ naming scheme
- make variables in codecs more consistent
- make kJfifHeader and kAdobeHeader use the ASCII form
- Make all codec getters noexcept
@netlify

netlify Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for exifi ready!

Name Link
🔨 Latest commit 281edc9
🔍 Latest deploy log https://app.netlify.com/projects/exifi/deploys/6abdaa644005380009cb3544
😎 Deploy Preview https://deploy-preview-61--exifi.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for exifi-api ready!

Name Link
🔨 Latest commit 281edc9
🔍 Latest deploy log https://app.netlify.com/projects/exifi-api/deploys/6abdaa642dc60600089103aa
😎 Deploy Preview https://deploy-preview-61--exifi-api.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@jeremy-code
jeremy-code merged commit 6cf11dc into main Oct 1, 2026
9 checks passed
@jeremy-code
jeremy-code deleted the dev/cpp branch October 1, 2026 00:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant