Page 1 of 2
23.13 mobile camera to image fields not working
Posted: 2023-06-29 02:48
by dge
I was excited to try using the camera to take a pic and upload via mobile on 23.13
But it does not bring up the option to use the camera, clicking the browse button (well, mine actually says "choose file") only takes me into the "select an image" from my phone. It does not bring the bottom popup, where the user can use the camera to take a picture as in the appgini demo video.
I don't see anywhere in appgini that any settings must be changed or enabled to make this work. I tried this on two different phones with the same result. Is there something I'm missing in terms of getting the CHOOSE AN ACTION menu to pop up from the bottom of the screen after clicking "choose file", where the camera can be selected?
David
Re: 23.13 mobile camera to image fields not working
Posted: 2023-06-30 11:45
by a.gneady
I don't see anywhere in appgini that any settings must be changed or enabled to make this work.
There is no setting to enable for this feature to work. It just works as long as your device indicates to the browser there is a camera. What I can think of as a cause of this issue is that you've disabled the camera permission for your browser. You can check this in the app info under the mobile Settings page > Apps. If your application is available online, feel free to send me a link to test this.
Re: 23.13 mobile camera to image fields not working
Posted: 2023-07-01 17:34
by dge
That was the issue (on both my phones!) Thanks Ahmad. Now I've got it working, here's something odd:
When I take a pic, holding the phone upright (vertically), this is how it looks before I save the record:

- BeforeSaving.jpg (20.83 KiB) Viewed 18174 times
But after saving the record, the image has turned sideways.

- AfterSaving.jpg (14.13 KiB) Viewed 18174 times
Oddly, if I take the pic while holding the phone horizontally: the image before saving is NOT a sideways image (good!), and after saving, the image is still in the correct orientation (not sideways!)
Why should I need to hold the phone horizontally to get a correctly saved image? (Your demo video shows the phone being held vertically)
In case it's relevant, here are the Appgini settings for this image field:

- Appgini_Pic_Settings.png (13.86 KiB) Viewed 18174 times
Also you see I've increased the max acceptable file size to 5000 KB as camera photos are generally pretty large (and some cameras don't give you the option of shooting at a reduced resolution). Even so, 5000KB (5M) is actually still too low for many images. I've disabled zooming in the hope that only the thumbnail will be stored and not the full resolution picture - trying not to fill up the server disk space with high resolution images that aren't needed.
Question - is this an effective strategy? In other words, should I just increase max file size to 8M or 10M so the image can be uploaded, and rely on appgini only storing the thumbnail and not keeping the high-res image? Or do we need some way to down-res the camera images so they don't fill up the server?
David
Re: 23.13 mobile camera to image fields not working
Posted: 2023-07-02 09:20
by a.gneady
Question - is this an effective strategy? In other words, should I just increase max file size to 8M or 10M so the image can be uploaded, and rely on appgini only storing the thumbnail and not keeping the high-res image? Or do we need some way to down-res the camera images so they don't fill up the server?
That's a pretty good question actually. AppGini won't remove the full-size image after creating the thumbnails. So, uploading high resolution photos would fill your server storage quickly. I'll work on adding options to handle this more efficiently. I'll also investigate the image orientation issue and work on a fix for it.
Thanks for your feedback!
Re: 23.13 mobile camera to image fields not working
Posted: 2023-07-04 00:23
by dge
Excellent. It would be great to have the ability to upload from camera easily. In our case we want to be able to take pics of our outgoing shipments to show everything was shipped and that it was marked and packed properly.
Re: 23.13 mobile camera to image fields not working
Posted: 2023-08-30 13:28
by gonzalo
Hi all:
Has anyone found an idea to lower the resolution of the pictures as they are uploaded (or after uploading) to save space in the servers?
Re: 23.13 mobile camera to image fields not working
Posted: 2023-09-03 18:04
by Marcelo Vitoria
I developed an app that uses the Android camera to control visitors in companies, and this problem with the image recording out of angle has been happening since 2018.
The idiotic solution we found is to ask the user to "rotate" the cell phone left or right to capture the image, but we noticed that in some Iphones this problem does not occur.
As for the file size, I believe that the AppGini IDE could have an option to activate the image size reduction using some FREE component like ImageMagic or another similar one.
Server space is quickly filled with an App that records images every day of 5 to 10MB in size on average and this would help a lot in space management.
Re: 23.13 mobile camera to image fields not working
Posted: 2023-09-12 11:51
by gonzalo
Appgini already does this to create the 2 thumbnails - ideally the incoming picture from the phone should be resized to the size of the file specified AND THEN the thumbnails could be created.
Re: 23.13 mobile camera to image fields not working
Posted: 2023-10-19 12:59
by gonzalo
Nothing??
Re: 23.13 mobile camera to image fields not working
Posted: 2023-11-13 15:37
by Marcelo Vitoria
a.gneady wrote: ↑2023-07-02 09:20
Question - is this an effective strategy? In other words, should I just increase max file size to 8M or 10M so the image can be uploaded, and rely on appgini only storing the thumbnail and not keeping the high-res image? Or do we need some way to down-res the camera images so they don't fill up the server?
That's a pretty good question actually. AppGini won't remove the full-size image after creating the thumbnails. So, uploading high resolution photos would fill your server storage quickly. I'll work on adding options to handle this more efficiently. I'll also investigate the image orientation issue and work on a fix for it.
Thanks for your feedback!
Hi A. Geneady
I did a search about trying to change the orientation of images via PHP and found this text, as you are more experienced than me, maybe it can give you some light on how to solve the problem:
"Hi, guys!
Have you ever noticed that when a photo is taken via cell phone, its rotation “bugs†when resized?
This is due to the fact that the photo is rotated but with a “metadata†that indicates the rotation, this means that when it is opened on the computer the computer corrects the rotation and you do not notice that the image is rotated.
First, we will consult all the photo’s metadata using the “exif_read_data†function:
See that a variable named “Orientation†is coming with a number.
This number indicates the rotation, so we just use the “imageflip†and “imagerotate†functions, and with that we have the function ready:
Code: Select all
<?
function ImageFixOrientation_JPG($filename)
{
$exif = exif_read_data($filename);
if (!empty($exif['Orientation']))
{
$image = imagecreatefromjpeg($filename);
switch ($exif['Orientation'])
{
case 1: // nothing
break;
case 2: // horizontal flip
imageflip($image, IMG_FLIP_HORIZONTAL);
break;
case 3: // 180 rotate left
$image = imagerotate($image, 180, 0);
break;
case 4: // vertical flip
imageflip($image, IMG_FLIP_VERTICAL);
break;
case 5: // vertical flip + 90 rotate right
imageflip($image, IMG_FLIP_VERTICAL);
$image = imagerotate($image, -90, 0);
break;
case 6: // 90 rotate right
$image = imagerotate($image, -90, 0);
break;
case 7: // horizontal flip + 90 rotate right
imageflip($image, IMG_FLIP_HORIZONTAL);
$image = imagerotate($image, -90, 0);
break;
case 8: // 90 rotate left
$image = imagerotate($image, 90, 0);
break;
}
imagejpeg($image, $filename, 100);
}
}
?>
Sample of use:
ImageFixOrientation_JPG(“Image/image1.jpgâ€);
In my case, only the Thumbs that end in "TV" and "DV" have the wrong orientation, the main one in better resolution is recording with the correct orientation.
I hope this helps, if it is possible to create a function suitable for Appgini in the hooks, it would temporarily solve the problem until it is corrected in a new release of AppGini.
Good luck !
Re: 23.13 mobile camera to image fields not working
Posted: 2023-11-14 08:31
by a.gneady
Thanks for the helpful info. I'll take this into consideration in future versions.
Re: 23.13 mobile camera to image fields not working
Posted: 2023-12-15 16:45
by Marcelo Vitoria
Hi Ahmad,
Is there any estimate on when this problem will be fixed?
OR even if you can send some temporary function to add to the projects?
We have customers canceling services and image orientation is becoming a big problem for us.
Thanks
Re: 23.13 mobile camera to image fields not working
Posted: 2023-12-23 03:03
by dge
I too am quite disappointed that there are no improvements or fixes to this, especially after Ahmed said "I'll also investigate the image orientation issue and work on a fix for it." There have been a couple of releases since then but no mention of this issue.
It's tantalizingly close to being quite useful - and at the same time, frustratingly far. As a long time Appgini user I've come to the unfortunate realization that "stay tuned" means "probably never".
Yes, Appgini is wonderful and it's inexpensive. That much is not in question. It's such a great tool, but I can't help but wonder why the deficiencies of features like this are simply left to the users to try to figure out patches and workarounds and upgrades.
David
Re: 23.13 mobile camera to image fields not working
Posted: 2023-12-23 16:05
by a.gneady
I plan to address this in January release. Stay tuned!
Re: 23.13 mobile camera to image fields not working
Posted: 2023-12-24 17:52
by D Oliveira
Looking at first glance it doesnt seem like a php change at all, I would suggest using jquery in the tablename-dv.js file to capture the element's class and change orientation accordingly if the image aspect ratio is portrait instead of landscape, meaning height > width then orientation +90 degrees rotation.
Code: Select all
$(document).ready(function() {
// Select all images within the specified context, adjust selector as needed
$('img').each(function() {
var $this = $(this); // Cache the current image
var width = $this.width(); // Get the width of the image
var height = $this.height(); // Get the height of the image
// Check if the image is portrait
if(height > width) {
// Apply a 90-degree rotation
$this.css({
'transform': 'rotate(90deg)',
'transform-origin': '50% 50%' // Ensures the image rotates about its center
});
}
});
});
Re: 23.13 mobile camera to image fields not working
Posted: 2024-02-06 19:48
by Marcelo Vitoria
a.gneady wrote: ↑2023-12-23 16:05
I plan to address this in January release. Stay tuned!
Hi Ahmad,
Would there be a new date for solving this image orientation problem?
Re: 23.13 mobile camera to image fields not working
Posted: 2024-02-11 20:00
by a.gneady
Hopefully in the upcoming release this month.
Re: 23.13 mobile camera to image fields not working -
Posted: 2024-03-09 18:23
by dge
Happy to see a new Appgini update today.
Disappointed to see this camera/image deficiency not addressed. But also not surprised.
The pattern holds true:
1) Ahmed says he's going to fix something in the next release.
2) Next release comes, it's not fixed.
3) Someone asks about it again, Ahmed says "hopefully in the next release"
4) Next release, it's not fixed.
Love Appgini, but we have to accept that it's up to us to find our own fixes and workarounds.
Just the way it is.
"post by a.gneady » 11 Feb 2024, 20:00
Hopefully in the upcoming release this month"
Re: 23.13 mobile camera to image fields not working
Posted: 2024-03-12 20:05
by Marcelo Vitoria
Temporary procedure to take photos with your Smartphone in the Correct orientation in applications generated in AppGini:
https://www.youtube.com/watch?v=3AGALTzWRNE
Re: 23.13 mobile camera to image fields not working
Posted: 2024-04-07 18:05
by Marcelo Vitoria
a.gneady wrote: ↑2024-02-11 20:00
Hopefully in the upcoming release this month.
In update 24.12, the image orientation problem when saving was resolved.
You can rotate the cell phone and take photos and the AG no longer rotates the image, it records it in the correct position.
Thanks Ahmad for the correction and good luck.
Re: 23.13 mobile camera to image fields not working
Posted: 2024-04-07 18:57
by a.gneady
Glad to hear it's working now. AppGini 24.12 includes code for detecting the image orientation and rotating the thumbnail accordingly. This requires the EXIF extension to be installed/enabled in PHP.
Re: 23.13 mobile camera to image fields not working
Posted: 2024-04-19 17:03
by gonzalo
No info on the stored size of the pictures?
Re: 23.13 mobile camera to image fields not working
Posted: 2024-04-21 18:24
by dge
Sounds like still no way to reduce image size.
Nice to see the orientation fixed but if it can't auto resize images to lower resolution it's still impractical to upload camera images directly to appgini.
It's still a half cooked feature. Will we ever see the auto resize image function? I'm not holding my breath.
Re: 23.13 mobile camera to image fields not working
Posted: 2024-04-22 04:28
by jsetzer
Please don't get me wrong, in my opinion neither reducing/enlarging uploaded images nor changing the image resolution should be included in the AppGini standard.
In my opinion, these are specific requirements for database-based, data-centric web apps that probably only a few users (and certainly not all users) need.
That's why AppGini is structured as a development PLATFORM: We developers, who, by purchasing AG, have decided on DIY development, can implement something like this using hooks. If you implement your specific requirements via hooks, then these changes will at least not have any negative impact on all other AppGini developers. That's what hooks are for.
If, on the other hand, this should become standard, next to programming the PHP and perhaps Javascript parts, BigProf needs to program a configurable UI for enabling/disabling this behaviour per field and for configuring sizes, resolution, aspect-ratio and perhaps more options like conversion to PNG etc. and some "rebuild" parts for admin backend.
Personally, I think there are more important features missing in standard where all of us could benefit and I hope BigProf will spend more time on security, data integrity and common functions. This is just my personal opinion.
Re: 23.13 mobile camera to image fields not working
Posted: 2024-04-22 19:47
by dge
Except Appgini is not marketed and sold as a development platform.
From appgini.com homepage:
Empower Your Business with Tailored Collaborative Apps. No Coding Required.
Discover the AppGini Advantage: Experience unparalleled ease-of-use, rapid results, and flexibility in building web apps to streamline your operations
Create a web-based database app in 5 minutes with no-code
Watch screencast showing how to create a web database application in 5 minutes, no code, using AppGini.
Save hundreds of programming man-hours with our powerful no-code platform
AppGini takes care of the repetitive data management code that would normally take hundreds of hours of expensive programmers' time and effort. This could translate to thousands of dollars in savings; give you the time to focus on more critical business logic, the confidence of having a high quality code base that has been time-tested by thousands of users over and over, and the efficiency of making the best use of your time rather than re-inventing the wheel