Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
2 views
2 pages
V 3 Js
Uploaded by
Ravi Teja
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
Download
Save
Save v3js For Later
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
0 ratings
0% found this document useful (0 votes)
2 views
2 pages
V 3 Js
Uploaded by
Ravi Teja
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
Carousel Previous
Carousel Next
Download
Save
Save v3js For Later
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
Download
Save v3js For Later
You are on page 1
/ 2
Search
Fullscreen
const fs = require('fs-extra');
const path = require('path');
const os = require('os');
const { Storage } = require('@google-cloud/storage');
const sharp = require('sharp');
const getExif = require('exif-async');
const parseDMS = require('parse-dms');
exports.extractExif = async (file, context) => {
try {
console.log("Running v3 function...");
const gcsFile = file;
const storage = new Storage();
const finalBucket = storage.bucket('sp24-50100-rpillala-gj-final');
console.log(`File name: ${gcsFile.name}`);
console.log(`Content type: ${gcsFile.contentType}`);
const workingDir = path.join(os.tmpdir(), 'thumbnails');
await fs.ensureDir(workingDir);
// Extracting the new filename generated by v2 function
const finalFileName = `${gcsFile.generation}.${gcsFile.contentType ===
'image/jpeg' ? 'jpg' : 'png'}`;
const tempFilePath = path.join(workingDir, finalFileName);
console.log(`Downloading file ${gcsFile.name} from final bucket to $
{tempFilePath}`);
await finalBucket.file(finalFileName).download({ destination:
tempFilePath });
console.log(`File downloaded to ${tempFilePath}`);
// Read EXIF data from the downloaded image
const exifData = await getExif(tempFilePath);
if (exifData && exifData.gps) {
// Convert GPS coordinates to decimal format
const gpsDecimal = getGPSCoordinates(exifData.gps);
console.log("Latitude:", gpsDecimal.lat);
console.log("Longitude:", gpsDecimal.lon);
// Return the EXIF data
return {
latitude: gpsDecimal.lat,
longitude: gpsDecimal.lon
};
} else {
console.log("No EXIF data found or GPS data missing.");
return null;
}
console.log("v3 function completed successfully.");
} catch (error) {
console.error("Error in v3 function:", error);
throw error;
}
};
// Helper function to convert GPS coordinates to decimal format
function getGPSCoordinates(g) {
const latstring = `${g.GPSLatitude[0]}:${g.GPSLatitude[1]}:${g.GPSLatitude[2]}$
{g.GPSLatitudeRef}`;
const lonstring = `${g.GPSLongitude[0]}:${g.GPSLongitude[1]}:$
{g.GPSLongitude[2]}${g.GPSLongitudeRef}`;
const degCoords = parseDMS(`${latstring} ${lonstring}`);
return degCoords;
}
You might also like
Introduction To Google Earth Engine (GEE) - CENG688
PDF
100% (1)
Introduction To Google Earth Engine (GEE) - CENG688
47 pages
Airless Spray
PDF
No ratings yet
Airless Spray
31 pages
Full Download Canon EOS 5D Mark III Digital Field Guide 1st Edition Charlotte K. Lowrie PDF
PDF
No ratings yet
Full Download Canon EOS 5D Mark III Digital Field Guide 1st Edition Charlotte K. Lowrie PDF
77 pages
Non-Ferrous Metal Smelting
PDF
100% (1)
Non-Ferrous Metal Smelting
47 pages
Postgis-3 2
PDF
No ratings yet
Postgis-3 2
903 pages
Reporting and Sharing The Findings
PDF
68% (19)
Reporting and Sharing The Findings
12 pages
Boleto Processing Brazil
PDF
No ratings yet
Boleto Processing Brazil
13 pages
Postgis 3
PDF
No ratings yet
Postgis 3
935 pages
Postgis-3 1 1
PDF
No ratings yet
Postgis-3 1 1
874 pages
AP MK8 MK9 Installation Manual
PDF
No ratings yet
AP MK8 MK9 Installation Manual
48 pages
Converted GPX
PDF
No ratings yet
Converted GPX
188 pages
Travers Level 2
PDF
No ratings yet
Travers Level 2
23 pages
Pump Handbook
PDF
0% (1)
Pump Handbook
3 pages
Lab 2 - Image Preprocessing Techniques Using Google Earth Engine
PDF
No ratings yet
Lab 2 - Image Preprocessing Techniques Using Google Earth Engine
11 pages
Rails Gis Hacks Tutorial 170907
PDF
100% (2)
Rails Gis Hacks Tutorial 170907
36 pages
What Is The Major Function of The Coating On An Arc Welding Electrode
PDF
100% (5)
What Is The Major Function of The Coating On An Arc Welding Electrode
7 pages
Bill Updated
PDF
No ratings yet
Bill Updated
1 page
QGIS Tutorial Feb 2021
PDF
No ratings yet
QGIS Tutorial Feb 2021
65 pages
Lab 1.georeferencing
PDF
No ratings yet
Lab 1.georeferencing
8 pages
2.3 Worksheet
PDF
No ratings yet
2.3 Worksheet
5 pages
Butler Et Al. - 2016 - The GeoJSON Format
PDF
No ratings yet
Butler Et Al. - 2016 - The GeoJSON Format
28 pages
Geocoding: Maxbox Starter93 With Geocoding
PDF
100% (1)
Geocoding: Maxbox Starter93 With Geocoding
7 pages
Firebase
PDF
No ratings yet
Firebase
40 pages
Geocoding On Rails
PDF
No ratings yet
Geocoding On Rails
63 pages
Great Circle Sailing
PDF
100% (1)
Great Circle Sailing
3 pages
Geopy Documentation: Release 1.18.0
PDF
No ratings yet
Geopy Documentation: Release 1.18.0
77 pages
Combine Description Child Entities (External)
PDF
No ratings yet
Combine Description Child Entities (External)
14 pages
Google Maps
PDF
No ratings yet
Google Maps
19 pages
Cinematography
PDF
No ratings yet
Cinematography
29 pages
Parker Hose Crimping Equipment 2
PDF
No ratings yet
Parker Hose Crimping Equipment 2
30 pages
Research Paper 1
PDF
No ratings yet
Research Paper 1
8 pages
Rab Laci KTH
PDF
No ratings yet
Rab Laci KTH
19 pages
Google Map
PDF
100% (1)
Google Map
16 pages
Buildings Footprints
PDF
No ratings yet
Buildings Footprints
5 pages
Maxbox Starter142 Geocoding Distance
PDF
No ratings yet
Maxbox Starter142 Geocoding Distance
5 pages
Chapter 9 Dust Collector
PDF
No ratings yet
Chapter 9 Dust Collector
16 pages
Ex3 Tab Lab
PDF
No ratings yet
Ex3 Tab Lab
19 pages
Underground Structures: Tunnel and Bridge Technologies
PDF
No ratings yet
Underground Structures: Tunnel and Bridge Technologies
19 pages
PG Routing Workshop
PDF
No ratings yet
PG Routing Workshop
43 pages
Code Gs 11
PDF
No ratings yet
Code Gs 11
5 pages
Printed Organic Electronics: C. Serbutoviez - Chef Du Laboratoire Des Composants Imprimés
PDF
No ratings yet
Printed Organic Electronics: C. Serbutoviez - Chef Du Laboratoire Des Composants Imprimés
37 pages
Realtime Device Tracker (Final)
PDF
No ratings yet
Realtime Device Tracker (Final)
11 pages
Seasa Goa
PDF
No ratings yet
Seasa Goa
11 pages
App Dev With Open Source
PDF
No ratings yet
App Dev With Open Source
57 pages
JBI Critical Appraisal Haris
PDF
No ratings yet
JBI Critical Appraisal Haris
6 pages
Working Guilt File
PDF
No ratings yet
Working Guilt File
9 pages
Google Maps Platform Google For Developers
PDF
No ratings yet
Google Maps Platform Google For Developers
2 pages
Pgrouting Workshop
PDF
No ratings yet
Pgrouting Workshop
46 pages
PDF 1750278344315
PDF
No ratings yet
PDF 1750278344315
2 pages
Inclinometro
PDF
No ratings yet
Inclinometro
6 pages
DLL - English 5 - Q3 - W4
PDF
No ratings yet
DLL - English 5 - Q3 - W4
12 pages
20MK02 - Exercise 03
PDF
No ratings yet
20MK02 - Exercise 03
11 pages
Novo (A) Documento de Texto
PDF
No ratings yet
Novo (A) Documento de Texto
1 page
Firebase
PDF
No ratings yet
Firebase
1 page
Workflow Agisoft Photoscan Micasense
PDF
No ratings yet
Workflow Agisoft Photoscan Micasense
17 pages
Ooooo
PDF
No ratings yet
Ooooo
5 pages
Puntos Extraidos de Gps 24 de Marzo
PDF
No ratings yet
Puntos Extraidos de Gps 24 de Marzo
11 pages
3.3 Usage of The Geolocation API
PDF
No ratings yet
3.3 Usage of The Geolocation API
6 pages
NV FLEXO Stands PL Oct, 2024
PDF
No ratings yet
NV FLEXO Stands PL Oct, 2024
4 pages
PDF 1750278201458
PDF
No ratings yet
PDF 1750278201458
2 pages
Create A Programming Project For A Real Device
PDF
No ratings yet
Create A Programming Project For A Real Device
11 pages
Proyecto Coursera UCSD Graphs
PDF
No ratings yet
Proyecto Coursera UCSD Graphs
19 pages
Terraformer D Ts
PDF
No ratings yet
Terraformer D Ts
7 pages
Simulacion de Viaje
PDF
No ratings yet
Simulacion de Viaje
3 pages
EXP - No 9 Location Tracker CORDOVA
PDF
No ratings yet
EXP - No 9 Location Tracker CORDOVA
5 pages
TFD
PDF
No ratings yet
TFD
2 pages
PDF 1751320430396
PDF
No ratings yet
PDF 1751320430396
2 pages
Dailey Resume
PDF
No ratings yet
Dailey Resume
2 pages
Reading.4 Wind - Turbines
PDF
No ratings yet
Reading.4 Wind - Turbines
5 pages
V 2 Js
PDF
No ratings yet
V 2 Js
2 pages
Repository Case Labview Common GPS: Red: VI Contains Errors
PDF
No ratings yet
Repository Case Labview Common GPS: Red: VI Contains Errors
10 pages
V 4 Js
PDF
No ratings yet
V 4 Js
1 page
789C Parameter List Report: Type of Report Selected Machine Sorted Criterion
PDF
No ratings yet
789C Parameter List Report: Type of Report Selected Machine Sorted Criterion
2 pages
Assistant Methods
PDF
No ratings yet
Assistant Methods
2 pages
New Text Document
PDF
No ratings yet
New Text Document
2 pages
Distance
PDF
No ratings yet
Distance
1 page
Course Outline Ecm241
PDF
No ratings yet
Course Outline Ecm241
3 pages
Oracle Plsql1
PDF
No ratings yet
Oracle Plsql1
4 pages
1 Tourism in LEDCs Case Study
PDF
No ratings yet
1 Tourism in LEDCs Case Study
2 pages
Shibari
PDF
No ratings yet
Shibari
1 page
Gmi Application Form
PDF
No ratings yet
Gmi Application Form
1 page
Conductive Pen
PDF
No ratings yet
Conductive Pen
2 pages
Me 23219
PDF
No ratings yet
Me 23219
1 page
NgRx SignalStore: An effortless solution for state management
From Everand
NgRx SignalStore: An effortless solution for state management
Abdelfattah Ragab
No ratings yet
Build your own Blockchain: Make your own blockchain and trading bot on your pc
From Everand
Build your own Blockchain: Make your own blockchain and trading bot on your pc
Magelan Cybersecurity
No ratings yet
No Ph.D. Game Design With Three.js
From Everand
No Ph.D. Game Design With Three.js
Nikiforos Kontopoulos
No ratings yet
Javascript Assessment Test
From Everand
Javascript Assessment Test
Edward Yao
No ratings yet
Oracle Certified Professional Java Programmer OCPJP 1Z0 809
From Everand
Oracle Certified Professional Java Programmer OCPJP 1Z0 809
Manish Soni
No ratings yet
How to a Developers Guide to 4k: Developer edition, #3
From Everand
How to a Developers Guide to 4k: Developer edition, #3
Xinc Cyberwizard
No ratings yet
Computer Engineering Laboratory Solution Primer
From Everand
Computer Engineering Laboratory Solution Primer
Karan Bhandari
No ratings yet