@threedddplus/logoeditor 0.0.122 → 0.0.123

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7350,7 +7350,7 @@ var UploadLogo = function UploadLogo() {
7350
7350
 
7351
7351
  var svgConverter = /*#__PURE__*/function () {
7352
7352
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(data) {
7353
- var ext, tiffData, aiToSvg, formData, response;
7353
+ var ext, tiffData, aiToSvg, formData, response, blob, imageUrl;
7354
7354
  return _regeneratorRuntime().wrap(function _callee$(_context) {
7355
7355
  while (1) switch (_context.prev = _context.next) {
7356
7356
  case 0:
@@ -7364,7 +7364,7 @@ var UploadLogo = function UploadLogo() {
7364
7364
  break;
7365
7365
  }
7366
7366
  imageToSVG(data, ext, true);
7367
- _context.next = 27;
7367
+ _context.next = 36;
7368
7368
  break;
7369
7369
  case 6:
7370
7370
  if (!(ext === 'tif' || ext === 'tiff')) {
@@ -7376,7 +7376,7 @@ var UploadLogo = function UploadLogo() {
7376
7376
  case 9:
7377
7377
  tiffData = _context.sent;
7378
7378
  imageToSVG(tiffData, ext);
7379
- _context.next = 27;
7379
+ _context.next = 36;
7380
7380
  break;
7381
7381
  case 13:
7382
7382
  if (!(ext === 'ai' || ext === 'pdf')) {
@@ -7400,7 +7400,7 @@ var UploadLogo = function UploadLogo() {
7400
7400
  loading: false
7401
7401
  });
7402
7402
  });
7403
- _context.next = 27;
7403
+ _context.next = 36;
7404
7404
  break;
7405
7405
  case 21:
7406
7406
  formData = new FormData();
@@ -7417,27 +7417,34 @@ var UploadLogo = function UploadLogo() {
7417
7417
  .then((res) => {console.log(res);})
7418
7418
  .catch((err) => {console.log(err)});*/
7419
7419
  _context.next = 25;
7420
- return fetch('https://vectorizer.ai/api/v1/vectorize', {
7420
+ return fetch('https://imagesharpher-f4b4o225iq-ue.a.run.app/upload', {
7421
7421
  method: 'POST',
7422
- headers: {
7423
- user: 'vks34swmmj4s8wg',
7424
- pass: 'f9ivolvk1mc5khc7ja53bp2rst5d4cuk5q02oqfoj3mn1ag3sig2'
7425
- },
7422
+ /*headers :{
7423
+ user: 'vks34swmmj4s8wg',
7424
+ pass: 'f9ivolvk1mc5khc7ja53bp2rst5d4cuk5q02oqfoj3mn1ag3sig2',
7425
+ },*/
7426
7426
  body: formData
7427
7427
  });
7428
7428
  case 25:
7429
7429
  response = _context.sent;
7430
- if (response.ok) {
7431
- console.log(response);
7432
- // const blob = await response.blob();
7433
- // const imageUrl = URL.createObjectURL(blob);
7434
- // imageToSVG(imageUrl, ext);
7435
- } else {
7436
- alert('Failed to process the image');
7430
+ if (!response.ok) {
7431
+ _context.next = 35;
7432
+ break;
7437
7433
  }
7438
- case 27:
7434
+ console.log(response);
7435
+ _context.next = 30;
7436
+ return response.blob();
7437
+ case 30:
7438
+ blob = _context.sent;
7439
+ imageUrl = URL.createObjectURL(blob);
7440
+ imageToSVG(imageUrl, ext);
7441
+ _context.next = 36;
7442
+ break;
7443
+ case 35:
7444
+ alert('Failed to process the image');
7445
+ case 36:
7439
7446
  setSelectedFile(null);
7440
- case 28:
7447
+ case 37:
7441
7448
  case "end":
7442
7449
  return _context.stop();
7443
7450
  }