converters

package
v0.0.1-Beta01 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 17, 2024 License: MPL-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package converters - NekoBlog backend server data converters. This file is for avatar file converter. Copyright (c) [2024], Author(s): - WhitePaper233<[email protected]>

Package converters - NekoBlog backend server data converters. This file is for avatar file converter. Copyright (c) [2024], Author(s): - WhitePaper233<[email protected]>

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResizeAvatar

func ResizeAvatar(fileType types.ImageFileType, file *multipart.File) ([]byte, error)

ResizeAvatar 调整头像大小。

参数:

  • fileType:图片文件类型。
  • file:图片文件

返回值:

  • []byte:调整后的头像文件的字节切片。
  • error:如果在调整过程中发生错误,则返回相应的错误信息,否则返回nil。

func ResizePostImage

func ResizePostImage(fileType types.ImageFileType, file *multipart.File) ([]byte, error)

ResizePostImage 调整图片大小。

参数:

  • fileType:图片文件类型。
  • file:图片文件

返回值:

  • []byte:调整后的头像文件的字节切片。
  • error:如果在调整过程中发生错误,则返回相应的错误信息,否则返回nil。

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL