当前位置:网站首页>如何实现根据照片获取地理位置及如何防御照片泄漏地理位置
如何实现根据照片获取地理位置及如何防御照片泄漏地理位置
2022-04-23 09:24:00 【Python 集中营】
首先,说明一下python确实可以根据照片获取地理位置,但是也是有一定的限制条件的。
获取照片地理位置的实现思路是这样的:通过提取照片中的经纬度信息。然后通过经纬度信息找到具体的地理位置信息。
安装可以读取经纬度信息的python非标准库exifread
pip install exifread
将该模块导入到当前代码块中。
import exifread as ex
编写照片信息读取函数,获取照片中的经纬度信息。
def read_image():
'''
经纬度信息读取函数
:return:
'''
image = open('C:/sc.jpg', 'rb') # 打开照片文件
messages = ex.process_file(image) # 获取照片信息
'''遍历提取照片信息'''
for message in messages:
print('照片信息:', message)
if message == "GPS GPSLongitude":
print("经度 =", messages[message], messages['GPS GPSLatitudeRef'])
elif message == "GPS GPSLatitude":
print("纬度 =", messages[message], messages['GPS GPSLongitudeRef'])
if __name__ == '__main__':
read_image()
通过上面的处理已经获取当前的经纬度信息,现在只需要根据经纬度信息获取具体的地理位置就可以了。
直接使用web网站去查询地理位置就可以了。
地理位置转换网址:http://www.giscalculator.com/enter_regeocode_input/
最后,那么如何防止自己的手机照片被追踪到地址呢,需要说明一下照片被获取地理位置信息的硬性条件。
1、手机是安卓手机才会出现被追踪位置的情况。 2、手机拍摄时开启了GPS定位的照片才会存储GPS位置信息,否则是获取不到的。 3、手机照片在发送过程中必须是原图发送才会出现将照片其他信息发送给别人的情况。
根据上面情况,手机在拍照时关闭定位、发送给别人照片时为避免信息泄漏不要使用原图发送,若是苹果手机暂时不用担心啦!
【往期精彩】
又是樱花盛开的季节,使用小乌龟来画一颗樱花树吧!
Python 读取PDF文件为文本字符并转换为音频...
python 获取最新房价信息-以北京房价为例
办公自动化:Image图片转换成PDF文档存储...
python做一个微型美颜图片处理器,十行代码即可完成...
用python做一个文本翻译器,自动将中文翻译成英文,超方便的!
小王,给这2000个客户发一下节日祝福的邮件...
python 一行命令开启网络间的文件共享...
PyQt5 批量删除 Excel 重复数据,多个文件、自定义重复项一键删除...
再见XShell,这款国人开源的终端命令行工具更nice!
python 表情包下载器,轻松下载上万个表情包、斗图不用愁...
Python 自动清理电脑垃圾文件,一键启动即可...
版权声明
本文为[Python 集中营]所创,转载请带上原文链接,感谢
https://blog.csdn.net/chengxuyuan_110/article/details/124355467
边栏推荐
- Summary of common concepts and problems of linear algebra in postgraduate entrance examination
- ATSS(CVPR2020)
- 【SQL server速成之路】数据库的视图和游标
- Kettle experiment conversion case
- Two ways for flutter providers to share data
- 【读书笔记】《Verilog数字系统设计教程》 第5章 条件语句、循环语句和块语句(附思考题答案)
- Cross domain configuration error: when allowcredentials is true, allowedorigins cannot contain the special value "*“
- MySQL - Chapter 1 (data types in MySQL)
- Base de la technologie électronique numérique 3.1 aperçu du circuit de porte, 3.2 circuit de porte à diode semi - conductrice
- Data visualization: use Excel to make radar chart
猜你喜欢
Harbor enterprise image management system
Flink SQL realizes the integration of stream and batch
What is augmented reality technology? Where can it be used?
資源打包關系依賴樹
【读书笔记】《Verilog数字系统设计教程》 第5章 条件语句、循环语句和块语句(附思考题答案)
EmuElec 编译总结
Go language learning notes - array | go language from scratch
The most concerned occupations after 00: civil servants ranked second. What was the first?
npm ERR! network
Kettle experiment conversion case
随机推荐
KVM installation and deployment
Using sqlmap injection to obtain the account and password of the website administrator
What is monitoring intelligent playback and how to use intelligent playback to query video recording
GoLand debug go use - white record
Rembg split mask
Unfortunately, I broke the leader's confidential documents and spit blood to share the code skills of backup files
DVWA range practice
Failed to download esp32 program, prompting timeout
Kettle实验 (三)
Get trustedinstaller permission
Go language learning notes - slice, map | go language from scratch
MySQL小練習(僅適合初學者,非初學者勿進)
2D 01 Backpack
How to render web pages
Detailed explanation of delete, truncate and drop principles in MySQL database
Learn FPGA (from Verilog to HLS)
First principle mind map
Go language learning notes - structure | go language from scratch
AQS & reentrantlock implementation principle
Operation not allowed for a result set of type resultset TYPE_ FORWARD_ ONLY. Explain in detail