-
-
Notifications
You must be signed in to change notification settings - Fork 218
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fd3b1b0
commit 10de07b
Showing
11 changed files
with
94 additions
and
61 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
generate -> avg: 3.48ms, executions: [3.48ms] | ||
add_cols -> avg: 153.00ns, executions: [361.00ns, 138.00ns, 120.00ns, 64.00ns, 159.00ns, 76.00ns] | ||
generate -> avg: 3.35ms, executions: [3.35ms] | ||
add_cols -> avg: 168.00ns, executions: [496.00ns, 137.00ns, 121.00ns, 69.00ns, 119.00ns, 66.00ns] | ||
file_size -> 222.72Kb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package image | ||
|
||
import ( | ||
"errors" | ||
|
||
"github.com/johnfercher/maroto/v2/pkg/consts/extension" | ||
"github.com/johnfercher/maroto/v2/pkg/core/entity" | ||
) | ||
|
||
func FromBytes(bytes []byte, ext extension.Type) (*entity.Image, error) { | ||
if !ext.IsValid() { | ||
return nil, errors.New("invalid image format") | ||
} | ||
|
||
return &entity.Image{ | ||
Bytes: bytes, | ||
Extension: ext, | ||
}, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters