Skip to content

Commit

Permalink
Clean-up internal P/Invoke layer
Browse files Browse the repository at this point in the history
  • Loading branch information
kleisauke committed Jan 14, 2024
1 parent f31f1ea commit f4d3cb3
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 15 deletions.
2 changes: 1 addition & 1 deletion src/NetVips/Image.cs
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,7 @@ public static Image NewFromMemoryCopy(
/// <exception cref="VipsException">If unable to make temp file from <paramref name="format"/>.</exception>
public static Image NewTempFile(string format)
{
var vi = VipsImage.NewTempFile(format);
var vi = VipsImage.NewTempFile(Encoding.UTF8.GetBytes(format));
if (vi == IntPtr.Zero)
{
throw new VipsException("unable to make temp file");
Expand Down
14 changes: 0 additions & 14 deletions src/NetVips/Internal/Vips.cs
Original file line number Diff line number Diff line change
Expand Up @@ -489,15 +489,6 @@ internal static extern int Get(Image image, [MarshalAs(UnmanagedType.LPStr)] str
[DllImport(Libraries.Vips, CallingConvention = CallingConvention.Cdecl,
EntryPoint = "vips_image_get_fields")]
internal static extern IntPtr GetFields(Image image);

internal static IntPtr NewTempFile(string format)
{
var bytes = Encoding.UTF8.GetBytes(format);
return NewTempFile(bytes);
}

[SuppressUnmanagedCodeSecurity, UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate void EvalSignal(IntPtr imagePtr, IntPtr progressPtr, IntPtr userDataPtr);
}

internal static class VipsInterpolate
Expand Down Expand Up @@ -597,11 +588,6 @@ internal static class VipsForeign
EntryPoint = "vips_foreign_find_save_buffer")]
internal static extern IntPtr FindSaveBuffer(byte[] name);

[SuppressUnmanagedCodeSecurity]
[DllImport(Libraries.Vips, CallingConvention = CallingConvention.Cdecl,
EntryPoint = "vips_foreign_find_save_target")]
internal static extern IntPtr FindSaveTarget(IntPtr name);

[SuppressUnmanagedCodeSecurity]
[DllImport(Libraries.Vips, CallingConvention = CallingConvention.Cdecl,
EntryPoint = "vips_foreign_find_save_target")]
Expand Down

0 comments on commit f4d3cb3

Please sign in to comment.