cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
lknudson
Level: Powered On

Image Quality in CDS 2.0

Hi Community,

 

I have seen some related posts, but I feel like I need some confirmation.

 

I have a camera control and image download control on my PowerApp.  User takes a picture or downloads an image (usually jpg) into a collection which I show in a gallery.  The user can select images in the gallery and see detail in full page image control screen.  Quality is great.  So far so good.

 

Then the user selects one or more images to save, and these are patched to CDS 2.0 entity image field.

 

Now the user shows all images from entity in a gallery.  They select one to see a large full page image control screen.  Quality is very bad - very blurry - resolution of original is gone.

 

This image function is part of a much larger mobile management app that has been under development for some time.  I could swear that this was not an issue earlier on in the program.

 

What am I missing?  Can anyone pass along some help on this?

 

Collection image:

CollectionImage.JPG

 

 

Patched image:CDS Patched Image.JPG

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User
Super User

Re: Image Quality in CDS 2.0

You could go back to using SQL. You can use varbinary(Max) to store image data (actually, any file data) from the Add Picture control. You can use varchar(Max) if storing data from the camera control.

Tip: If you want to display an uploaded image back in PowerApps, create a view using the For JSON command to convert varbinary to datauri - this gives a big speed boost displaying images.

You might also consider storing your image data in Azure Blob storage and simply storing a 'pointer' to the image data.

View solution in original post

13 REPLIES 13
Community Support Team
Community Support Team

Re: Image Quality in CDS 2.0

Hi @lknudson ,

 

Can you please share the related formulas here?

 

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
lknudson
Level: Powered On

Re: Image Quality in CDS 2.0

Collection PictureList patches to custom CDS Entity DailyJobLogPictures with:

 

ForAll(PictureList,Patch(DailyJobLogPictures,Defaults(DailyJobLogPictures),{APrimaryName:"Pics",PicCompany:CurCo,PicJobID:CurJob, PicDate:dfltDate,PicImageSmiley Tonguepic, PicGeo: Concatenate(Text(Location.Latitude), " ", Text(Location.Longitude)),PicNoteIDSmiley TongueNoteID,PicDescSmiley TongueicNote}))

 

The Image in both cases is:

[ Gallery of Collection or patched CDS ].Selected.IPpic

Image Position: Fit

 

Is this what you wanted?

 

Thanks!

lknudson
Level: Powered On

Re: Image Quality in CDS 2.0

OK, I guess I found out what's at the root of problem.

Common Data Service > Types of Entity Fields:

  • "When an image is uploaded, it will be resized to a maximum size of 144 pixels by 144 pixels. People should resize or crop the images before they upload them so that they will display well using this size. All images are cropped to be square. If both sides of an image are smaller than 144 pixels, the image will be cropped to be a square with the dimensions of the smaller side."

Ouch!

 

 I had switched to CDS from SQL data source a while ago in order to add in attachment ability for records, but now I see the image capability seems to be virtually only able to handle thumbnail quality images.

 

Any ideas for me here?

 

Thanks!

Highlighted
Super User
Super User

Re: Image Quality in CDS 2.0

You could go back to using SQL. You can use varbinary(Max) to store image data (actually, any file data) from the Add Picture control. You can use varchar(Max) if storing data from the camera control.

Tip: If you want to display an uploaded image back in PowerApps, create a view using the For JSON command to convert varbinary to datauri - this gives a big speed boost displaying images.

You might also consider storing your image data in Azure Blob storage and simply storing a 'pointer' to the image data.

View solution in original post

lknudson
Level: Powered On

Re: Image Quality in CDS 2.0

If I go back to SQL, I'll need to work out accomodation for PDF attachments which I can probably do with more pointer work.

 

I see that Todd Baginski has a good tutorial on BLOB storage, so I'm going to see if that might work for both PDF and Image requirements:

http://toddbaginski.com/blog/how-to-work-with-azure-blob-storage-in-powerapps/  

 

Thanks for the response!

Super User
Super User

Re: Image Quality in CDS 2.0

You can use the same technique for PDF if you want. Use the Add Picture control, when the dialog appears, set the file filter to All Files* and just select your PDF. Patch the selected file data into a varbinary(max) field just as you would with an image.

* Unfortunately I don't think you can specify the file filter you want, so users will need to be trained to change from 'image files' to 'all files' so they can see and add their PDFs.

 

Azure Blob storage is also a good option. Shane Young has a good video on that on YouTube.

lknudson
Level: Powered On

Re: Image Quality in CDS 2.0

Thanks!

PowerApps Staff richdiMSFT
PowerApps Staff

Re: Image Quality in CDS 2.0

You could also store the images as an attachment link you are for the PDFs. It won't be as easy for getting and retrieving them for your app. But they can be stored in CDS. 

 

A true image type has been a common customer request so I expect we will make this easier with CDS as we more tightly integrated. 

 

Hope this helps,

Rich

Black_Magic100
Level: Powered On

Re: Image Quality in CDS 2.0

Hey not to hijack your post, but how did you display your image that was stored in the collection to be so large.  I can get them to show using the gallery control, but that is with a 144x144 image.  None of the other larger controls seem to work.

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

Top Kudoed Authors
Users Online
Currently online: 146 members 3,124 guests
Please welcome our newest community members: