You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, on Android, the callback passes an array of dimensions. On iOS the callback always passes string 'universal'.
To describe this behaviour, the documentation should be something like:
getSupportedPreviewSize(cb, [errorCallback])
CameraPreview.getSupportedPreviewSize(function(dimensions) {
if (typeof dimensions === 'string') {
// string 'universal' : all dimensions allowed.
// If you need the content of the preview to exactly match the content of the picture,
// then choose a preview aspect ratio (width / height) that matches the aspect ratio of
// one of the supported picture sizes
console.log(dimensions);
} else {
// note that the portrait version, width and height swapped, of these dimensions are also supported
dimensions.forEach(function(dimension){
console.log(dimension.width + 'x' + dimension.height);
});
}
});
The documentation for getSupportedPictureSize reads:
However, the callback for getSupportedPictureSize passes an array of dimensions, so the documentation should be something like:
CameraPreview.getSupportedPictureSize(function(dimensions){
// note that the portrait version, width and height swapped, of these dimensions are also supported
dimensions.forEach(function(dimension) {
console.log(dimension.width + 'x' + dimension.height);
});
});
The text was updated successfully, but these errors were encountered:
anneb
changed the title
incorrect documentation for method getSupportedPreviewSize
incorrect documentation for methods getSupportedPreviewSize / getSupportedPictureSize
Mar 5, 2017
getSupportedPreviewSize kind of seems like an unnecessary method. Does anyone have a use case for this? If it is used for something aspect ratio wise, would a method that gets aspect ratio be more suitable?
Any other comments or suggestion you have let me know
I am using it for getting supported aspect ratio's, but I suppose I could use getSupportedPictureSize for that too? On Android, a list of supported preview sizes is passed to the callback. Would preview sizes not on the list also work?
The current documentation in README.md for method getSupportedPreviewSize reads:
However, on Android, the callback passes an array of dimensions. On iOS the callback always passes string 'universal'.
To describe this behaviour, the documentation should be something like:
The documentation for getSupportedPictureSize reads:
However, the callback for getSupportedPictureSize passes an array of dimensions, so the documentation should be something like:
The text was updated successfully, but these errors were encountered: