ParkSangGwon / TedPicker

Multiple image select library for Android. Take a picture or Select from gallary

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Square image

leonardojobim opened this issue · comments

Is it possible to ensure square images ?
As config.setCameraHeight(int h) receives an integer value that corresponds to a resource not to a real value, it does not accept the calculated screen width value.

@Leo-One
If you want square image, you can pass width value to 'setCameraHeight()'
what method does not accept calculate screen width?

@ParkSangGwon

If I execute the code below:

WindowManager wm = (WindowManager) getContext().getSystemService(Context.WINDOW_SERVICE);
Display display = wm.getDefaultDisplay();
Point size = new Point();
display.getSize(size);
int width = size.x;

Config config = new Config();
config.setCameraHeight(width);
config.setSelectionMin(1);
config.setSelectionLimit(1);

ImagePickerActivity.setConfig(config);

I receive the error:

FATAL EXCEPTION: main 
android.content.res.Resources$NotFoundException: Resource ID #0x438

It is because the parameter of the method Config .setCameraHeight(int width); expects a resource, not the real value of width.

@Leo-One setCameraHeight parameter must be resource ID not width integer.
I will add function for using integer parameter.

So as it is not possible to define width size as resource ID (it depends on device), then it is not possible to set square image at moment. Is it correct ?