Skip to content

Conversation

@OrangeHoopla
Copy link
Contributor

@OrangeHoopla OrangeHoopla commented Nov 4, 2025

Made ab_glyph and rustdct optional and the respective modules they are being used in features. The only other dependency that doesn't span multiple modules is approx which would make geometric_transformations a feature if we wanted to make it optional.
note: this will break other people's use of this library if they have the default-features set to false and are using either drawing::text or image_hash

@OrangeHoopla OrangeHoopla changed the title Make external dependencies optional #725 Make external dependencies optional Nov 4, 2025
@cospectrum
Copy link
Contributor

making DistanceFrom public isn't related to optional dependencies

@OrangeHoopla
Copy link
Contributor Author

making DistanceFrom public isn't related to optional dependencies

My bad @cospectrum that was for another commit. I removed it.

Copy link
Contributor

@cospectrum cospectrum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is 1 new image hash function on master which does not require dct and there will be more. So could you please replace image_hash feature with fft feature (not dct, since fft is the main shared dependency, this will help minimise future feature bloat). You will need to cfg feature on hash function instead of the entire module.

@OrangeHoopla
Copy link
Contributor Author

OrangeHoopla commented Dec 22, 2025

I started working on this and it causes a cascade of warnings if/when the feature is removed. Would you rather I go through add #[cfg(feature = "fft")] to all imports that are not being used when the feature is removed(a little ugly imo) or do we want someone to see warning when they remove this feature?(probably not the best thing either)

@OrangeHoopla
Copy link
Contributor Author

Nvm I think a mixture of #[allow(dead_code)] would be the solution.

Merge conflict resolution, added an extra space which fmt did not like
@cospectrum
Copy link
Contributor

cospectrum commented Dec 22, 2025

I don't like unused imports. They still may slow down compile time I think. Lets put entire modules such that phash, signals, bits behind the feature

Image::from_vec(img.width(), img.height(), img_buf).unwrap()
}

#[allow(dead_code)]
Copy link
Contributor

@cospectrum cospectrum Dec 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

try to remove allow(dead_code) in this file

@cospectrum
Copy link
Contributor

1 thread is remaining. You can do it!

@OrangeHoopla
Copy link
Contributor Author

...sorry about that I got pulled away from the computer for a bit.

@cospectrum cospectrum merged commit 0f77e9e into image-rs:main Dec 22, 2025
18 of 19 checks passed
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.

2 participants