在数据库中存储EXIF信息 [英] Storing EXIF information in Database

查看:290
本文介绍了在数据库中存储EXIF信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从数据库中存储EXIF数据的最佳方式是什么(我的例子中是MySQL)。这是一个照片共享网站。

What's the best way to store EXIF data from photos in a Database (MySQL in my case). This is for a photo sharing site.

什么是最重要的标签,什么是可丢弃的?

What are the most important Tags, and what are discardable?

推荐答案

我们很难确定您的重要性。一种方法是将所有的属性存储在一个类似这样的表中(近似SQL语法):

It's hard for us to determine what is important for you. One approach might be to store all the properties in a table created something like this (approximate SQL syntax):

create table exif_info (
    photo_id integer,
    name varchar,
    value varchar
);

此表格中的每一行都会将一个EXIF属性与 one 照片。所以你需要一整行的行来保存所有的EXIF属性为一张照片,但这正是关系数据库擅长。

Each row in this table associates one EXIF property with one photo. So you would need a whole bunch of rows to hold all the EXIF properties for a single photo, but this is exactly what relational databases are good at.

这样,您可以存储所有可用的信息,而不必现在决定以后可能会有什么重要。

In this way, you can store all the available information without having to decide now what might be important later.

这篇关于在数据库中存储EXIF信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆