mirror of
https://github.com/dsoprea/go-exif.git
synced 2025-04-29 06:11:01 +00:00
In lieu of dropping in next release. We needed this in order to write some unit-tests for exifcommon functionality, and this is common functionality anyway (by any definition of common thus far). - common/ifd.go: Added NewIfdIdentityFromString. The above allowed us to cover this with unit-tests. - This was required for go-exif-knife, to get IFD-paths from the command-line.
41 lines
1.1 KiB
Go
41 lines
1.1 KiB
Go
package exif
|
|
|
|
import (
|
|
"github.com/dsoprea/go-logging"
|
|
|
|
"github.com/dsoprea/go-exif/v2/common"
|
|
)
|
|
|
|
// TODO(dustin): This file now exists for backwards-compatibility only.
|
|
|
|
// NewIfdMapping returns a new IfdMapping struct.
|
|
//
|
|
// RELEASE(dustin): This is a bridging function for backwards-compatibility. Remove this in the next release.
|
|
func NewIfdMapping() (ifdMapping *exifcommon.IfdMapping) {
|
|
return exifcommon.NewIfdMapping()
|
|
}
|
|
|
|
// NewIfdMappingWithStandard retruns a new IfdMapping struct preloaded with the
|
|
// standard IFDs.
|
|
//
|
|
// RELEASE(dustin): This is a bridging function for backwards-compatibility. Remove this in the next release.
|
|
func NewIfdMappingWithStandard() (ifdMapping *exifcommon.IfdMapping) {
|
|
return exifcommon.NewIfdMappingWithStandard()
|
|
}
|
|
|
|
// LoadStandardIfds loads the standard IFDs into the mapping.
|
|
//
|
|
// RELEASE(dustin): This is a bridging function for backwards-compatibility. Remove this in the next release.
|
|
func LoadStandardIfds(im *exifcommon.IfdMapping) (err error) {
|
|
defer func() {
|
|
if state := recover(); state != nil {
|
|
err = log.Wrap(state.(error))
|
|
}
|
|
}()
|
|
|
|
err = exifcommon.LoadStandardIfds(im)
|
|
log.PanicIf(err)
|
|
|
|
return nil
|
|
}
|