Giter Club home page Giter Club logo

Comments (10)

syoyo avatar syoyo commented on August 12, 2024

My opinion is that it would be preferable to remove this dependency and leave it up to the user to include their zlib-compatible header (either zlib.h or miniz.h, as in my case) before including tinyexr.h.

This looks good so I made a change in the recent commit.

Thank you for reporting an issue!

from tinyexr.

zigguratvertigo avatar zigguratvertigo commented on August 12, 2024

I've also made similar changes on my side, where we have other modules in our code relying on miniz already.

We've basically removed lines 475 to 6909, and now only rely on:

#if TINYEXR_USE_MINIZ
#include <miniz/miniz.h>
#else
#include "zlib.h"
#endif

from tinyexr.

syoyo avatar syoyo commented on August 12, 2024

we have other modules in our code relying on miniz already.

Okay, I'm considering to introduce TINYEXR_USE_EXTERNAL_MINIZ define, which assumes user code already includes miniz header.

from tinyexr.

john-chapman avatar john-chapman commented on August 12, 2024

I don't see that it's necessary to add a new define, it's simpler just to disable the embedded version and require that the user included the header (or a compatible one) prior to including tinyexr.h. This relies on Miniz keeping a zlib-compatible interface but that's probably a safe assumption.

A key point for me is that I'd prefer not to have to modify tinyexr.h at all so that I can just drop in any updates.

from tinyexr.

syoyo avatar syoyo commented on August 12, 2024

I don't see that it's necessary to add a new define, it's simpler just to disable the embedded version and require that the user included the header (or a compatible one) prior to including tinyexr.h

I see. Let me give some time to figure out what is the best way to solve the issue with minimal modification.

from tinyexr.

syoyo avatar syoyo commented on August 12, 2024

Do you need miniz specific API for your project, @zigguratvertigo?

If you are ok to use zlib-compatible API, as @john-chapman suggests, there is no modification required anymore and you can include external miniz.h as follows.

#include <miniz/miniz.h> // Use zlib compatible API

#define TINYDNG_USE_MINIZ (0) // Disable embedded miniz code in tinyexr.h
#include "tinyexr.h"

from tinyexr.

john-chapman avatar john-chapman commented on August 12, 2024

@syoyo One additional problem I noticed: there's a block of #pragma warning starting line 4377 which is disabled with TINYEXR_USE_MINIZ, but probably shouldn't be.

from tinyexr.

syoyo avatar syoyo commented on August 12, 2024

I see > there's a block of #pragma warning starting line 4377 which is disabled with TINYEXR_USE_MINIZ, but probably shouldn't be.

from tinyexr.

syoyo avatar syoyo commented on August 12, 2024

Fixed wrong pragma warning push/pop pair in this commit: 13a6b15

from tinyexr.

syoyo avatar syoyo commented on August 12, 2024

Plese reopen the issue if you still get a problem.

from tinyexr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.