diff --git a/exiv.go b/exiv.go index f8e0096..c05c6f2 100644 --- a/exiv.go +++ b/exiv.go @@ -120,7 +120,10 @@ func (i *Image) GetBytes() []byte { header.Len = size header.Data = uintptr(unsafe.Pointer(ptr)) - return slice + target := make([]byte, len(slice)) + copy(target, slice) + + return target } // PixelWidth returns the width of the image in pixels