Error: no "view" mailcap rules found for type "image/png"

JTTI (Jyotismita Tripathy) 0 Reputation points
2024-11-06T15:13:00.1866667+00:00

I am trying to read the image files from AML workspace using python code. I am getting Error: no "view" mailcap rules found for type "image/png" when i trying to show image. here is the code i am using:


fs = AzureMachineLearningFileSystem(data_asset.path) 

image_path="path/to/image.tiff"
with fs.open(image_path) as f:
     img = Image.open(f)
     img.show()

Appreciate your kind suggestion.

Thanks

Azure Machine Learning
Azure Machine Learning
An Azure machine learning service for building and deploying models.
3,338 questions
{count} votes

1 answer

Sort by: Most helpful
  1. santoshkc 15,355 Reputation points Microsoft External Staff Moderator
    2024-11-07T10:41:03.6133333+00:00

    Hi @JTTI (Jyotismita Tripathy),

    Thank you for reaching out to Microsoft Q&A forum!

    To read image files from an Azure Machine Learning workspace, you can use either registered datasets or a datastore (like Azure Blob Storage). First, load the workspace and retrieve the dataset or datastore. If you're using a dataset, download it locally; if you're accessing data from a datastore, use the AzureMachineLearningFileSystem to open the image directly from the cloud. You can then use any third-party libraries to open and display the image in your Python environment.

    I hope you understand! Thank you.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.