23.13 mobile camera to image fields not working

Please report bugs and any annoyances here. Kindly include all possible details: steps to reproduce, expected result, actual result, screenshots, ... etc.
Post Reply
dge
Posts: 24
Joined: 2013-12-05 02:54

23.13 mobile camera to image fields not working

Post by dge » 2023-06-29 02:48

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
Attachments
chooseaction.png
chooseaction.png (26.67 KiB) Viewed 7974 times

User avatar
a.gneady
Site Admin
Posts: 1276
Joined: 2012-09-27 14:46
Contact:

Re: 23.13 mobile camera to image fields not working

Post by a.gneady » 2023-06-30 11:45

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.
:idea: AppGini plugins to add more power to your apps:
  • DataTalk is an innovative AppGini plugin based on ChatGPT that allows you to interact with your AppGini database using natural language questions, without writing any SQL. Check the demo video
  • Mass Update plugin: Update multiple records at once and improve your workflow efficiency.
  • Check our other plugins and get a generous discount of up to 30% when buying 2 or more plugins.

dge
Posts: 24
Joined: 2013-12-05 02:54

Re: 23.13 mobile camera to image fields not working

Post by dge » 2023-07-01 17:34

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
BeforeSaving.jpg (20.83 KiB) Viewed 7890 times
But after saving the record, the image has turned sideways.
AfterSaving.jpg
AfterSaving.jpg (14.13 KiB) Viewed 7890 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
Appgini_Pic_Settings.png (13.86 KiB) Viewed 7890 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

User avatar
a.gneady
Site Admin
Posts: 1276
Joined: 2012-09-27 14:46
Contact:

Re: 23.13 mobile camera to image fields not working

Post by a.gneady » 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!
:idea: AppGini plugins to add more power to your apps:
  • DataTalk is an innovative AppGini plugin based on ChatGPT that allows you to interact with your AppGini database using natural language questions, without writing any SQL. Check the demo video
  • Mass Update plugin: Update multiple records at once and improve your workflow efficiency.
  • Check our other plugins and get a generous discount of up to 30% when buying 2 or more plugins.

dge
Posts: 24
Joined: 2013-12-05 02:54

Re: 23.13 mobile camera to image fields not working

Post by dge » 2023-07-04 00:23

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.

gonzalo
Posts: 14
Joined: 2015-08-24 14:42

Re: 23.13 mobile camera to image fields not working

Post by gonzalo » 2023-08-30 13:28

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?

User avatar
Marcelo Vitoria
Veteran Member
Posts: 56
Joined: 2016-10-11 12:08

Re: 23.13 mobile camera to image fields not working

Post by Marcelo Vitoria » 2023-09-03 18:04

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.
Marcelo Vitoria
Coding since 1984 Basic Sinclair!
Clipper Summer´87 - Visual Foxpro - VB6
AppGini 24.10 - AdminLTE
https://www.workspace.inf.br

gonzalo
Posts: 14
Joined: 2015-08-24 14:42

Re: 23.13 mobile camera to image fields not working

Post by gonzalo » 2023-09-12 11:51

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.

gonzalo
Posts: 14
Joined: 2015-08-24 14:42

Re: 23.13 mobile camera to image fields not working

Post by gonzalo » 2023-10-19 12:59

Nothing??

User avatar
Marcelo Vitoria
Veteran Member
Posts: 56
Joined: 2016-10-11 12:08

Re: 23.13 mobile camera to image fields not working

Post by Marcelo Vitoria » 2023-11-13 15:37

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:

Image

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 !
Marcelo Vitoria
Coding since 1984 Basic Sinclair!
Clipper Summer´87 - Visual Foxpro - VB6
AppGini 24.10 - AdminLTE
https://www.workspace.inf.br

User avatar
a.gneady
Site Admin
Posts: 1276
Joined: 2012-09-27 14:46
Contact:

Re: 23.13 mobile camera to image fields not working

Post by a.gneady » 2023-11-14 08:31

Thanks for the helpful info. I'll take this into consideration in future versions.
:idea: AppGini plugins to add more power to your apps:
  • DataTalk is an innovative AppGini plugin based on ChatGPT that allows you to interact with your AppGini database using natural language questions, without writing any SQL. Check the demo video
  • Mass Update plugin: Update multiple records at once and improve your workflow efficiency.
  • Check our other plugins and get a generous discount of up to 30% when buying 2 or more plugins.

User avatar
Marcelo Vitoria
Veteran Member
Posts: 56
Joined: 2016-10-11 12:08

Re: 23.13 mobile camera to image fields not working

Post by Marcelo Vitoria » 2023-12-15 16:45

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
Marcelo Vitoria
Coding since 1984 Basic Sinclair!
Clipper Summer´87 - Visual Foxpro - VB6
AppGini 24.10 - AdminLTE
https://www.workspace.inf.br

dge
Posts: 24
Joined: 2013-12-05 02:54

Re: 23.13 mobile camera to image fields not working

Post by dge » 2023-12-23 03:03

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

User avatar
a.gneady
Site Admin
Posts: 1276
Joined: 2012-09-27 14:46
Contact:

Re: 23.13 mobile camera to image fields not working

Post by a.gneady » 2023-12-23 16:05

I plan to address this in January release. Stay tuned!
:idea: AppGini plugins to add more power to your apps:
  • DataTalk is an innovative AppGini plugin based on ChatGPT that allows you to interact with your AppGini database using natural language questions, without writing any SQL. Check the demo video
  • Mass Update plugin: Update multiple records at once and improve your workflow efficiency.
  • Check our other plugins and get a generous discount of up to 30% when buying 2 or more plugins.

User avatar
D Oliveira
AppGini Super Hero
AppGini Super Hero
Posts: 345
Joined: 2018-03-04 09:30
Location: Orlando, FL

Re: 23.13 mobile camera to image fields not working

Post by D Oliveira » 2023-12-24 17:52

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
            });
        }
    });
});

User avatar
Marcelo Vitoria
Veteran Member
Posts: 56
Joined: 2016-10-11 12:08

Re: 23.13 mobile camera to image fields not working

Post by Marcelo Vitoria » 2024-02-06 19:48

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?
Marcelo Vitoria
Coding since 1984 Basic Sinclair!
Clipper Summer´87 - Visual Foxpro - VB6
AppGini 24.10 - AdminLTE
https://www.workspace.inf.br

User avatar
a.gneady
Site Admin
Posts: 1276
Joined: 2012-09-27 14:46
Contact:

Re: 23.13 mobile camera to image fields not working

Post by a.gneady » 2024-02-11 20:00

Hopefully in the upcoming release this month.
:idea: AppGini plugins to add more power to your apps:
  • DataTalk is an innovative AppGini plugin based on ChatGPT that allows you to interact with your AppGini database using natural language questions, without writing any SQL. Check the demo video
  • Mass Update plugin: Update multiple records at once and improve your workflow efficiency.
  • Check our other plugins and get a generous discount of up to 30% when buying 2 or more plugins.

Post Reply